mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
support animated artist images
This commit is contained in:
@@ -18,10 +18,14 @@ const BaseItemImage = (
|
||||
src?: null | string;
|
||||
},
|
||||
) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { src, ...rest } = props;
|
||||
|
||||
const imageUrl = useItemImageUrl({ id: props.id, itemType: props.itemType, size: 300 });
|
||||
const imageUrl = useItemImageUrl({
|
||||
id: props.id,
|
||||
imageUrl: src,
|
||||
itemType: props.itemType,
|
||||
size: 300,
|
||||
});
|
||||
|
||||
return <BaseImage src={imageUrl} {...rest} />;
|
||||
};
|
||||
|
||||
@@ -128,6 +128,7 @@ export const AlbumArtistDetailHeader = forwardRef((_props, ref: Ref<HTMLDivEleme
|
||||
|
||||
const imageUrl = useItemImageUrl({
|
||||
id: detailQuery.data?.imageId || undefined,
|
||||
imageUrl: detailQuery.data?.imageUrl,
|
||||
itemType: LibraryItem.ALBUM_ARTIST,
|
||||
type: 'itemCard',
|
||||
});
|
||||
|
||||
@@ -40,10 +40,17 @@ const AlbumArtistDetailRoute = () => {
|
||||
|
||||
const imageUrl = useItemImageUrl({
|
||||
id: detailQuery?.data?.imageId || undefined,
|
||||
imageUrl: detailQuery.data?.imageUrl,
|
||||
itemType: LibraryItem.ALBUM_ARTIST,
|
||||
type: 'header',
|
||||
});
|
||||
|
||||
const libraryBackgroundImageUrl = useItemImageUrl({
|
||||
id: detailQuery?.data?.imageId || undefined,
|
||||
itemType: LibraryItem.ALBUM_ARTIST,
|
||||
type: 'itemCard',
|
||||
});
|
||||
|
||||
const selectedImageUrl = imageUrl || detailQuery.data?.imageUrl;
|
||||
|
||||
const { background: backgroundColor, isLoading: isColorLoading } = useFastAverageColor({
|
||||
@@ -93,7 +100,7 @@ const AlbumArtistDetailRoute = () => {
|
||||
<LibraryBackgroundImage
|
||||
blur={artistBackgroundBlur}
|
||||
headerRef={headerRef}
|
||||
imageUrl={selectedImageUrl || ''}
|
||||
imageUrl={libraryBackgroundImageUrl || ''}
|
||||
/>
|
||||
) : (
|
||||
<LibraryBackgroundOverlay backgroundColor={background} headerRef={headerRef} />
|
||||
|
||||
@@ -333,7 +333,7 @@ const normalizeAlbumArtist = (
|
||||
item.similarArtists?.map((artist) => ({
|
||||
id: artist.id,
|
||||
imageId: null,
|
||||
imageUrl: artist?.artistImageUrl || null,
|
||||
imageUrl: artist?.artistImageUrl?.replace(/\?size=\d+/, '') || null,
|
||||
name: artist.name,
|
||||
})) || null,
|
||||
songCount,
|
||||
|
||||
Reference in New Issue
Block a user