mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
use correct id for runtime images in useItemImageUrl
This commit is contained in:
@@ -79,7 +79,7 @@ interface CarouselItemProps {
|
|||||||
|
|
||||||
const CarouselItem = ({ album }: CarouselItemProps) => {
|
const CarouselItem = ({ album }: CarouselItemProps) => {
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: album.id,
|
id: album.imageId || undefined,
|
||||||
itemType: LibraryItem.ALBUM,
|
itemType: LibraryItem.ALBUM,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export const AlbumDetailHeader = forwardRef<HTMLDivElement>((_props, ref) => {
|
|||||||
const releaseYear = detailQuery?.data?.releaseYear;
|
const releaseYear = detailQuery?.data?.releaseYear;
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: detailQuery?.data?.id,
|
id: detailQuery?.data?.imageId || undefined,
|
||||||
itemType: LibraryItem.ALBUM,
|
itemType: LibraryItem.ALBUM,
|
||||||
type: 'header',
|
type: 'header',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ export const ExpandedAlbumListItem = ({ internalState, item }: ExpandedAlbumList
|
|||||||
const player = usePlayer();
|
const player = usePlayer();
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: item.id,
|
id: item.imageId || undefined,
|
||||||
itemType: LibraryItem.ALBUM,
|
itemType: LibraryItem.ALBUM,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const AlbumDetailRoute = () => {
|
|||||||
|
|
||||||
const imageUrl =
|
const imageUrl =
|
||||||
useItemImageUrl({
|
useItemImageUrl({
|
||||||
id: albumId,
|
id: detailQuery?.data?.imageId || undefined,
|
||||||
itemType: LibraryItem.ALBUM,
|
itemType: LibraryItem.ALBUM,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
}) || '';
|
}) || '';
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ const DummyAlbumDetailRoute = () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: albumId,
|
id: detailQuery?.data?.imageId || undefined,
|
||||||
itemType: LibraryItem.ALBUM,
|
itemType: LibraryItem.ALBUM,
|
||||||
type: 'header',
|
type: 'header',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export const AlbumArtistDetailHeader = forwardRef((_props, ref: Ref<HTMLDivEleme
|
|||||||
const showRating = detailQuery?.data?._serverType === ServerType.NAVIDROME;
|
const showRating = detailQuery?.data?._serverType === ServerType.NAVIDROME;
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: detailQuery?.data?.id,
|
id: detailQuery?.data?.imageId || undefined,
|
||||||
itemType: LibraryItem.ALBUM_ARTIST,
|
itemType: LibraryItem.ALBUM_ARTIST,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export function AlbumArtistGridCarousel(props: AlbumArtistGridCarouselProps) {
|
|||||||
controls={controls}
|
controls={controls}
|
||||||
data={albumArtist}
|
data={albumArtist}
|
||||||
enableDrag
|
enableDrag
|
||||||
|
isRound
|
||||||
itemType={LibraryItem.ALBUM_ARTIST}
|
itemType={LibraryItem.ALBUM_ARTIST}
|
||||||
rows={rows}
|
rows={rows}
|
||||||
type="poster"
|
type="poster"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const useDiscordRpc = () => {
|
|||||||
|
|
||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
imageUrl: currentSong?.imageUrl,
|
imageUrl: currentSong?.imageUrl,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'table',
|
type: 'table',
|
||||||
|
|||||||
@@ -84,13 +84,13 @@ export const FullScreenPlayerImage = () => {
|
|||||||
const { nextSong } = usePlayerData();
|
const { nextSong } = usePlayerData();
|
||||||
|
|
||||||
const currentImageUrl = useItemImageUrl({
|
const currentImageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'fullScreenPlayer',
|
type: 'fullScreenPlayer',
|
||||||
});
|
});
|
||||||
|
|
||||||
const nextImageUrl = useItemImageUrl({
|
const nextImageUrl = useItemImageUrl({
|
||||||
id: nextSong?.id,
|
id: nextSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'fullScreenPlayer',
|
type: 'fullScreenPlayer',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -78,13 +78,13 @@ const BackgroundImage = memo(({ dynamicBackground, dynamicIsImage }: BackgroundI
|
|||||||
const { nextSong } = usePlayerData();
|
const { nextSong } = usePlayerData();
|
||||||
|
|
||||||
const currentImageUrl = useItemImageUrl({
|
const currentImageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
|
|
||||||
const nextImageUrl = useItemImageUrl({
|
const nextImageUrl = useItemImageUrl({
|
||||||
id: nextSong?.id,
|
id: nextSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
@@ -632,7 +632,7 @@ const PlayerContainer = memo(
|
|||||||
}: PlayerContainerProps) => {
|
}: PlayerContainerProps) => {
|
||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
imageUrl: currentSong?.imageUrl,
|
imageUrl: currentSong?.imageUrl,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
|
|||||||
@@ -84,14 +84,14 @@ export const MobileFullscreenPlayerAlbumArt = () => {
|
|||||||
const { nextSong } = usePlayerData();
|
const { nextSong } = usePlayerData();
|
||||||
|
|
||||||
const currentImageUrl = useItemImageUrl({
|
const currentImageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
size: mainImageDimensions.idealSize,
|
size: mainImageDimensions.idealSize,
|
||||||
type: 'fullScreenPlayer',
|
type: 'fullScreenPlayer',
|
||||||
});
|
});
|
||||||
|
|
||||||
const nextImageUrl = useItemImageUrl({
|
const nextImageUrl = useItemImageUrl({
|
||||||
id: nextSong?.id,
|
id: nextSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
size: mainImageDimensions.idealSize,
|
size: mainImageDimensions.idealSize,
|
||||||
type: 'fullScreenPlayer',
|
type: 'fullScreenPlayer',
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ const BackgroundImage = memo(({ dynamicBackground, dynamicIsImage }: BackgroundI
|
|||||||
const { nextSong } = usePlayerData();
|
const { nextSong } = usePlayerData();
|
||||||
|
|
||||||
const currentImageUrl = useItemImageUrl({
|
const currentImageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
|
|
||||||
const nextImageUrl = useItemImageUrl({
|
const nextImageUrl = useItemImageUrl({
|
||||||
id: nextSong?.id,
|
id: nextSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
});
|
});
|
||||||
@@ -303,7 +303,7 @@ const MobilePlayerContainer = memo(
|
|||||||
({ children, dynamicBackground, dynamicIsImage }: MobilePlayerContainerProps) => {
|
({ children, dynamicBackground, dynamicIsImage }: MobilePlayerContainerProps) => {
|
||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
imageUrl: currentSong?.imageUrl,
|
imageUrl: currentSong?.imageUrl,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const useMediaSession = () => {
|
|||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
imageUrl: currentSong?.imageUrl,
|
imageUrl: currentSong?.imageUrl,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const useMPRIS = () => {
|
|||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
imageUrl: currentSong?.imageUrl,
|
imageUrl: currentSong?.imageUrl,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export const useScrobble = () => {
|
|||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
imageUrl: currentSong?.imageUrl,
|
imageUrl: currentSong?.imageUrl,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ const calculateTitleSize = (title: string) => {
|
|||||||
|
|
||||||
interface LibraryHeaderMenuProps {
|
interface LibraryHeaderMenuProps {
|
||||||
favorite?: boolean;
|
favorite?: boolean;
|
||||||
onArtistRadio: () => void;
|
onArtistRadio?: () => void;
|
||||||
onFavorite?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
onFavorite?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
||||||
onMore?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
onMore?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
||||||
onPlay?: (type: Play) => void;
|
onPlay?: (type: Play) => void;
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ const PlaylistRowButton = memo(({ item, name, onContextMenu, to }: PlaylistRowBu
|
|||||||
);
|
);
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: item.id,
|
id: item.imageId || undefined,
|
||||||
itemType: LibraryItem.PLAYLIST,
|
itemType: LibraryItem.PLAYLIST,
|
||||||
type: 'table',
|
type: 'table',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ const SidebarImage = () => {
|
|||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
|
|
||||||
const imageUrl = useItemImageUrl({
|
const imageUrl = useItemImageUrl({
|
||||||
id: currentSong?.id,
|
id: currentSong?.imageId || undefined,
|
||||||
itemType: LibraryItem.SONG,
|
itemType: LibraryItem.SONG,
|
||||||
type: 'sidebar',
|
type: 'sidebar',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { toast } from '/@/shared/components/toast/toast';
|
|||||||
const queryCache = new QueryCache({
|
const queryCache = new QueryCache({
|
||||||
onError: (error: any, query) => {
|
onError: (error: any, query) => {
|
||||||
if (query.state.data !== undefined) {
|
if (query.state.data !== undefined) {
|
||||||
|
console.error(error);
|
||||||
toast.show({ message: `${error.message}`, type: 'error' });
|
toast.show({ message: `${error.message}`, type: 'error' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user