handle playback on new artist list

This commit is contained in:
jeffvli 2025-05-06 14:43:42 -07:00
parent b9611589ba
commit 4a3604b1a8
12 changed files with 121 additions and 31 deletions

View file

@ -20,6 +20,7 @@ import {
getAlbumArtistSongsById,
getSongsByQuery,
getGenreSongsById,
getArtistSongsById,
} from '/@/renderer/features/player/utils';
import { queryKeys } from '/@/renderer/api/query-keys';
import { useTranslation } from 'react-i18next';
@ -75,6 +76,8 @@ export const useHandlePlayQueueAdd = () => {
let songs: QueueSong[] | null = null;
let initialSongIndex = 0;
console.log('options :>> ', options);
if (byItemType) {
let songList: SongListResponse | undefined;
const { type: itemType, id } = byItemType;
@ -119,6 +122,13 @@ export const useHandlePlayQueueAdd = () => {
queryClient,
server,
});
} else if (itemType === LibraryItem.ARTIST) {
songList = await getArtistSongsById({
id,
query,
queryClient,
server,
});
} else if (itemType === LibraryItem.GENRE) {
songList = await getGenreSongsById({ id, query, queryClient, server });
} else if (itemType === LibraryItem.SONG) {