mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-25 04:28:40 -06:00
use album as id for track images
This commit is contained in:
@@ -26,12 +26,12 @@ export default function BlurhashedImage({
|
||||
const { data: image, isSuccess } = useQuery({
|
||||
queryKey: [
|
||||
QueryKeys.ItemImage,
|
||||
item.Id!,
|
||||
item.AlbumId ? item.AlbumId : item.Id!,
|
||||
type ?? ImageType.Primary,
|
||||
Math.ceil(width / 100) * 100, // Images are fetched at a higher, generic resolution
|
||||
Math.ceil(height ?? width / 100) * 100 // So these keys need to match
|
||||
],
|
||||
queryFn: () => fetchItemImage(item.Id!, type ?? ImageType.Primary, width, height ?? width),
|
||||
queryFn: () => fetchItemImage(item.AlbumId ? item.AlbumId : item.Id!, type ?? ImageType.Primary, width, height ?? width),
|
||||
staleTime: (1000 * 60 * 60) * 24, // 1 day, images probably don't refresh that often
|
||||
gcTime: (1000 * 30 * 1) * 1 // 30 seconds, these are stored on disk anyways so refetching is cheap
|
||||
});;
|
||||
|
||||
Reference in New Issue
Block a user