mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Add custom query prop to play queue add
This commit is contained in:
parent
6747fbb701
commit
93530008a9
3 changed files with 14 additions and 7 deletions
|
|
@ -29,7 +29,7 @@ export const useHandlePlayQueueAdd = () => {
|
|||
const handlePlayQueueAdd = useCallback(
|
||||
async (options: PlayQueueAddOptions) => {
|
||||
if (!server) return toast.error({ message: 'No server selected', type: 'error' });
|
||||
const { initialIndex, initialSongId, playType, byData, byItemType } = options;
|
||||
const { initialIndex, initialSongId, playType, byData, byItemType, query } = options;
|
||||
let songs: QueueSong[] | null = null;
|
||||
let initialSongIndex = 0;
|
||||
|
||||
|
|
@ -39,11 +39,11 @@ export const useHandlePlayQueueAdd = () => {
|
|||
|
||||
try {
|
||||
if (itemType === LibraryItem.PLAYLIST) {
|
||||
songList = await getPlaylistSongsById({ id: id?.[0], queryClient, server });
|
||||
songList = await getPlaylistSongsById({ id: id?.[0], query, queryClient, server });
|
||||
} else if (itemType === LibraryItem.ALBUM) {
|
||||
songList = await getAlbumSongsById({ id, queryClient, server });
|
||||
songList = await getAlbumSongsById({ id, query, queryClient, server });
|
||||
} else if (itemType === LibraryItem.ALBUM_ARTIST) {
|
||||
songList = await getAlbumArtistSongsById({ id, queryClient, server });
|
||||
songList = await getAlbumArtistSongsById({ id, query, queryClient, server });
|
||||
} else {
|
||||
songList = await getSongById({ id: id?.[0], queryClient, server });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue