mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
fix playlist image urls
This commit is contained in:
@@ -2,6 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useLocation, useParams } from 'react-router';
|
import { useLocation, useParams } from 'react-router';
|
||||||
|
|
||||||
|
import { useItemImageUrl } from '/@/renderer/components/item-image/item-image';
|
||||||
import { PageHeader } from '/@/renderer/components/page-header/page-header';
|
import { PageHeader } from '/@/renderer/components/page-header/page-header';
|
||||||
import { useListContext } from '/@/renderer/context/list-context';
|
import { useListContext } from '/@/renderer/context/list-context';
|
||||||
import { usePlayer } from '/@/renderer/features/player/context/player-context';
|
import { usePlayer } from '/@/renderer/features/player/context/player-context';
|
||||||
@@ -56,6 +57,12 @@ export const PlaylistDetailSongListHeader = ({
|
|||||||
player.addToQueueByData(listData as Song[], type || Play.NOW);
|
player.addToQueueByData(listData as Song[], type || Play.NOW);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const imageUrl = useItemImageUrl({
|
||||||
|
id: detailQuery?.data?.imageId || undefined,
|
||||||
|
itemType: LibraryItem.PLAYLIST,
|
||||||
|
type: 'header',
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap={0}>
|
<Stack gap={0}>
|
||||||
{collapsed ? (
|
{collapsed ? (
|
||||||
@@ -86,7 +93,7 @@ export const PlaylistDetailSongListHeader = ({
|
|||||||
</PageHeader>
|
</PageHeader>
|
||||||
) : (
|
) : (
|
||||||
<LibraryHeader
|
<LibraryHeader
|
||||||
imageUrl={detailQuery?.data?.imageUrl}
|
imageUrl={imageUrl}
|
||||||
item={{ route: AppRoute.PLAYLISTS, type: LibraryItem.PLAYLIST }}
|
item={{ route: AppRoute.PLAYLISTS, type: LibraryItem.PLAYLIST }}
|
||||||
title={detailQuery?.data?.name}
|
title={detailQuery?.data?.name}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ const normalizeSong = (
|
|||||||
songCount: null,
|
songCount: null,
|
||||||
})),
|
})),
|
||||||
id,
|
id,
|
||||||
imageId: item.id,
|
imageId: id,
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
lastPlayedAt: normalizePlayDate(item),
|
lastPlayedAt: normalizePlayDate(item),
|
||||||
lyrics: item.lyrics ? item.lyrics : null,
|
lyrics: item.lyrics ? item.lyrics : null,
|
||||||
|
|||||||
Reference in New Issue
Block a user