mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Add album list search
This commit is contained in:
parent
b742b814c0
commit
19f55b4a2e
8 changed files with 275 additions and 181 deletions
|
|
@ -252,9 +252,11 @@ const getAlbumList = async (args: AlbumListArgs): Promise<JFAlbumList> => {
|
|||
limit: query.limit,
|
||||
parentId: query.musicFolderId,
|
||||
recursive: true,
|
||||
searchTerm: query.searchTerm,
|
||||
sortBy: albumListSortMap.jellyfin[query.sortBy],
|
||||
sortOrder: sortOrderMap.jellyfin[query.sortOrder],
|
||||
startIndex: query.startIndex,
|
||||
...query.jfParams,
|
||||
};
|
||||
|
||||
const data = await api
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ const getAlbumList = async (args: AlbumListArgs): Promise<NDAlbumList> => {
|
|||
_order: sortOrderMap.navidrome[query.sortOrder],
|
||||
_sort: albumListSortMap.navidrome[query.sortBy],
|
||||
_start: query.startIndex,
|
||||
name: query.searchTerm,
|
||||
...query.ndParams,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -40,13 +40,33 @@ import {
|
|||
SSAlbumArtistDetail,
|
||||
SSMusicFolderList,
|
||||
} from '/@/renderer/api/subsonic.types';
|
||||
import { ServerListItem, ServerType } from '/@/renderer/types';
|
||||
|
||||
export enum SortOrder {
|
||||
ASC = 'ASC',
|
||||
DESC = 'DESC',
|
||||
}
|
||||
|
||||
export type ServerListItem = {
|
||||
credential: string;
|
||||
id: string;
|
||||
name: string;
|
||||
ndCredential?: string;
|
||||
type: ServerType;
|
||||
url: string;
|
||||
userId: string | null;
|
||||
username: string;
|
||||
};
|
||||
|
||||
export enum ServerType {
|
||||
JELLYFIN = 'jellyfin',
|
||||
NAVIDROME = 'navidrome',
|
||||
SUBSONIC = 'subsonic',
|
||||
}
|
||||
|
||||
export type QueueSong = Song & {
|
||||
uniqueId: string;
|
||||
};
|
||||
|
||||
type SortOrderMap = {
|
||||
jellyfin: Record<SortOrder, JFSortOrder>;
|
||||
navidrome: Record<SortOrder, NDSortOrder>;
|
||||
|
|
@ -281,6 +301,7 @@ export type AlbumListQuery = {
|
|||
starred?: boolean;
|
||||
year?: number;
|
||||
};
|
||||
searchTerm?: string;
|
||||
sortBy: AlbumListSort;
|
||||
sortOrder: SortOrder;
|
||||
startIndex: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue