mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-10 14:22:46 +02:00
fix incorrect imageId assignments (#1456)
This commit is contained in:
@@ -32,7 +32,7 @@ export const DragPreview = memo(({ data }: DragPreviewProps) => {
|
||||
const itemName = firstItem ? getItemName(firstItem) : 'Item';
|
||||
|
||||
const itemImage = useItemImageUrl({
|
||||
id: (firstItem as { id: string })?.id,
|
||||
id: (firstItem as { imageId: string })?.imageId,
|
||||
itemType: data.itemType || LibraryItem.SONG,
|
||||
type: 'table',
|
||||
});
|
||||
|
||||
@@ -119,7 +119,7 @@ const CarouselItem = ({ album }: CarouselItemProps) => {
|
||||
<ItemImage
|
||||
className={styles.albumImage}
|
||||
containerClassName={styles.albumImageContainer}
|
||||
id={album.id}
|
||||
id={album.imageId}
|
||||
itemType={LibraryItem.ALBUM}
|
||||
src={imageUrl}
|
||||
/>
|
||||
|
||||
@@ -314,7 +314,7 @@ const CompactItemCard = ({
|
||||
className={clsx(styles.image, {
|
||||
[styles.isRound]: isRound,
|
||||
})}
|
||||
id={data?.id}
|
||||
id={data?.imageId}
|
||||
itemType={itemType}
|
||||
src={(data as Album | AlbumArtist | Playlist | Song)?.imageUrl}
|
||||
/>
|
||||
@@ -532,7 +532,7 @@ const DefaultItemCard = ({
|
||||
<>
|
||||
<ItemImage
|
||||
className={clsx(styles.image, { [styles.isRound]: isRound })}
|
||||
id={data?.id}
|
||||
id={data?.imageId}
|
||||
itemType={itemType}
|
||||
src={(data as Album | AlbumArtist | Playlist | Song)?.imageUrl}
|
||||
/>
|
||||
|
||||
@@ -31,7 +31,7 @@ const getUnloaderIcon = (itemType: LibraryItem) => {
|
||||
};
|
||||
|
||||
const BaseItemImage = (
|
||||
props: Omit<ImageProps, 'src'> & {
|
||||
props: Omit<ImageProps, 'id' | 'src'> & {
|
||||
id?: null | string;
|
||||
itemType: LibraryItem;
|
||||
src?: null | string;
|
||||
@@ -46,13 +46,20 @@ const BaseItemImage = (
|
||||
size: 300,
|
||||
});
|
||||
|
||||
return <BaseImage src={imageUrl} unloaderIcon={getUnloaderIcon(props.itemType)} {...rest} />;
|
||||
return (
|
||||
<BaseImage
|
||||
src={imageUrl}
|
||||
unloaderIcon={getUnloaderIcon(props.itemType)}
|
||||
{...rest}
|
||||
id={props.id || undefined}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export const ItemImage = memo(BaseItemImage);
|
||||
|
||||
interface UseItemImageUrlProps {
|
||||
id?: string;
|
||||
id?: null | string;
|
||||
imageUrl?: null | string;
|
||||
itemType: LibraryItem;
|
||||
serverId?: string;
|
||||
|
||||
@@ -83,7 +83,7 @@ export const ImageColumn = (props: ItemTableListInnerColumn) => {
|
||||
[styles.imageContainerWithAspectRatio]:
|
||||
props.size === 'default' || props.size === 'large',
|
||||
})}
|
||||
id={item?.id}
|
||||
id={item?.imageId}
|
||||
itemType={item?._itemType}
|
||||
src={item?.imageUrl}
|
||||
/>
|
||||
|
||||
@@ -100,7 +100,7 @@ export const DefaultTitleCombinedColumn = (props: ItemTableListInnerColumn) => {
|
||||
>
|
||||
<ItemImage
|
||||
containerClassName={styles.image}
|
||||
id={item?.id}
|
||||
id={item?.imageId}
|
||||
itemType={item?._itemType}
|
||||
src={item?.imageUrl}
|
||||
/>
|
||||
@@ -236,7 +236,7 @@ export const QueueSongTitleCombinedColumn = (props: ItemTableListInnerColumn) =>
|
||||
>
|
||||
<ItemImage
|
||||
containerClassName={styles.image}
|
||||
id={item?.id}
|
||||
id={item?.imageId}
|
||||
itemType={item?._itemType}
|
||||
src={item?.imageUrl}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user