mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
support limitPercent for smart playlists
This commit is contained in:
@@ -600,6 +600,14 @@ const songListParameters = paginationParameters.extend({
|
||||
year: z.number().optional(),
|
||||
});
|
||||
|
||||
const playlistRules = z
|
||||
.object({
|
||||
limit: z.number().optional(),
|
||||
limitPercent: z.number().optional(),
|
||||
sort: z.string().optional(),
|
||||
})
|
||||
.catchall(z.any());
|
||||
|
||||
const playlist = z.object({
|
||||
comment: z.string(),
|
||||
createdAt: z.string(),
|
||||
@@ -611,7 +619,7 @@ const playlist = z.object({
|
||||
ownerName: z.string(),
|
||||
path: z.string(),
|
||||
public: z.boolean(),
|
||||
rules: z.record(z.string(), z.any()),
|
||||
rules: playlistRules,
|
||||
size: z.number(),
|
||||
songCount: z.number(),
|
||||
sync: z.boolean(),
|
||||
@@ -643,7 +651,7 @@ const createPlaylistParameters = z.object({
|
||||
name: z.string(),
|
||||
ownerId: z.string().optional(),
|
||||
public: z.boolean().optional(),
|
||||
rules: z.record(z.any()).optional(),
|
||||
rules: playlistRules.optional(),
|
||||
sync: z.boolean().optional(),
|
||||
});
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ export type Playlist = {
|
||||
owner: null | string;
|
||||
ownerId: null | string;
|
||||
public: boolean | null;
|
||||
rules?: null | Record<string, any>;
|
||||
rules?: null | PlaylistRules;
|
||||
size: null | number;
|
||||
songCount: null | number;
|
||||
sync?: boolean | null;
|
||||
@@ -947,7 +947,7 @@ export type CreatePlaylistBody = {
|
||||
name: string;
|
||||
ownerId?: string;
|
||||
public?: boolean;
|
||||
queryBuilderRules?: Record<string, any>;
|
||||
queryBuilderRules?: PlaylistRules;
|
||||
sync?: boolean;
|
||||
};
|
||||
|
||||
@@ -1009,6 +1009,12 @@ export interface PlaylistListQuery extends BaseQuery<PlaylistListSort> {
|
||||
// Playlist List
|
||||
export type PlaylistListResponse = BasePaginatedResponse<Playlist[]>;
|
||||
|
||||
export type PlaylistRules = Record<string, any> & {
|
||||
limit?: number;
|
||||
limitPercent?: number;
|
||||
sort?: string;
|
||||
};
|
||||
|
||||
export type RatingQuery = {
|
||||
id: string[];
|
||||
rating: number;
|
||||
@@ -1089,7 +1095,7 @@ export type UpdatePlaylistBody = {
|
||||
name: string;
|
||||
ownerId?: string;
|
||||
public?: boolean;
|
||||
queryBuilderRules?: Record<string, any>;
|
||||
queryBuilderRules?: PlaylistRules;
|
||||
sync?: boolean;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user