mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-29 23:19:27 -05:00
fixing shit
This commit is contained in:
@@ -4,14 +4,14 @@ import _ from "lodash"
|
||||
import Client from "../../../api/client"
|
||||
import { QueryConfig } from "../query.config";
|
||||
|
||||
export function fetchItemImage(itemId: string, imageType?: ImageType, size?: number) {
|
||||
export function fetchItemImage(itemId: string, imageType?: ImageType, width?: number, height?: number) {
|
||||
|
||||
return getImageApi(Client.api!)
|
||||
.getItemImage({
|
||||
itemId,
|
||||
imageType: imageType ? imageType : ImageType.Primary,
|
||||
width: size ? Math.floor(size) : QueryConfig.playerArtwork.width,
|
||||
height: size ? Math.floor(size) : QueryConfig.playerArtwork.height
|
||||
width: width ? Math.floor(width) : QueryConfig.playerArtwork.width,
|
||||
height: height ? Math.floor(height) : QueryConfig.playerArtwork.height
|
||||
}, {
|
||||
responseType: 'blob'
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ import { QueryKeys } from "../../enums/query-keys";
|
||||
import { fetchItemImage } from "./functions/images";
|
||||
import { ImageType } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
|
||||
export const useItemImage = (itemId: string, imageType?: ImageType, size?: number) => useQuery({
|
||||
queryKey: [QueryKeys.ItemImage, itemId, imageType, size],
|
||||
queryFn: () => fetchItemImage(itemId, imageType, size)
|
||||
export const useItemImage = (itemId: string, imageType?: ImageType, width?: number, height?: number) => useQuery({
|
||||
queryKey: [QueryKeys.ItemImage, itemId, imageType, width, height],
|
||||
queryFn: () => fetchItemImage(itemId, imageType, width, height)
|
||||
});
|
||||
Reference in New Issue
Block a user