mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
jellyfin random play filter
This commit is contained in:
parent
93377dcc4f
commit
80931d1b19
4 changed files with 37 additions and 2 deletions
|
|
@ -56,6 +56,7 @@ import {
|
|||
MoveItemArgs,
|
||||
DownloadArgs,
|
||||
TranscodingArgs,
|
||||
Played,
|
||||
} from '/@/renderer/api/types';
|
||||
import { jfApiClient } from '/@/renderer/api/jellyfin/jellyfin-api';
|
||||
import { jfNormalize } from './jellyfin-normalize';
|
||||
|
|
@ -892,6 +893,12 @@ const getRandomSongList = async (args: RandomSongListArgs): Promise<RandomSongLi
|
|||
Fields: 'Genres, DateCreated, MediaSources, ParentId',
|
||||
GenreIds: query.genre ? query.genre : undefined,
|
||||
IncludeItemTypes: 'Audio',
|
||||
IsPlayed:
|
||||
query.played === Played.Never
|
||||
? false
|
||||
: query.played === Played.Played
|
||||
? true
|
||||
: undefined,
|
||||
Limit: query.limit,
|
||||
ParentId: query.musicFolderId,
|
||||
Recursive: true,
|
||||
|
|
|
|||
|
|
@ -561,6 +561,7 @@ const songListParameters = paginationParameters.merge(
|
|||
GenreIds: z.string().optional(),
|
||||
Genres: z.string().optional(),
|
||||
IsFavorite: z.boolean().optional(),
|
||||
IsPlayed: z.boolean().optional(),
|
||||
SearchTerm: z.string().optional(),
|
||||
SortBy: z.nativeEnum(songListSort).optional(),
|
||||
Tags: z.string().optional(),
|
||||
|
|
|
|||
|
|
@ -1073,12 +1073,19 @@ export type SearchResponse = {
|
|||
songs: Song[];
|
||||
};
|
||||
|
||||
export enum Played {
|
||||
All = 'all',
|
||||
Never = 'never',
|
||||
Played = 'played',
|
||||
}
|
||||
|
||||
export type RandomSongListQuery = {
|
||||
genre?: string;
|
||||
limit?: number;
|
||||
maxYear?: number;
|
||||
minYear?: number;
|
||||
musicFolderId?: string;
|
||||
played: Played;
|
||||
};
|
||||
|
||||
export type RandomSongListArgs = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue