mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
Subsonic 2, general rework (#758)
This commit is contained in:
parent
31492fa9ef
commit
8cddbef701
69 changed files with 4625 additions and 3566 deletions
|
|
@ -494,17 +494,24 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => {
|
|||
const removeFromPlaylistMutation = useRemoveFromPlaylist();
|
||||
|
||||
const handleRemoveFromPlaylist = useCallback(() => {
|
||||
const songId =
|
||||
(serverType === ServerType.NAVIDROME || ServerType.JELLYFIN
|
||||
? ctx.dataNodes?.map((node) => node.data.playlistItemId)
|
||||
: ctx.dataNodes?.map((node) => node.data.id)) || [];
|
||||
let songId: string[] | undefined;
|
||||
|
||||
switch (serverType) {
|
||||
case ServerType.NAVIDROME:
|
||||
case ServerType.JELLYFIN:
|
||||
songId = ctx.dataNodes?.map((node) => node.data.playlistItemId);
|
||||
break;
|
||||
case ServerType.SUBSONIC:
|
||||
songId = ctx.dataNodes?.map((node) => node.rowIndex!.toString());
|
||||
break;
|
||||
}
|
||||
|
||||
const confirm = () => {
|
||||
removeFromPlaylistMutation.mutate(
|
||||
{
|
||||
query: {
|
||||
id: ctx.context.playlistId,
|
||||
songId,
|
||||
songId: songId || [],
|
||||
},
|
||||
serverId: ctx.data?.[0]?.serverId,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue