mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-24 12:08:44 -06:00
fucking images man
This commit is contained in:
@@ -34,16 +34,20 @@ export async function fetchItemImage(
|
||||
|
||||
data.text()
|
||||
.then((text) => {
|
||||
console.debug("Writing image to file")
|
||||
FileSystem.writeFile(
|
||||
getImagePath(itemId, imageType, width, height),
|
||||
text
|
||||
).then(() => {
|
||||
console.debug("Successfully wrote image to file")
|
||||
resolve(URL.createObjectURL(data));
|
||||
}).catch(() => {
|
||||
console.debug("Unable to write image to file, exiting...")
|
||||
resolve(URL.createObjectURL(data));
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
console.debug("Unable to read blob, not storing")
|
||||
resolve(URL.createObjectURL(data));
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,6 +6,5 @@ import { ImageType } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
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),
|
||||
gcTime: Infinity,
|
||||
retry: 3
|
||||
});
|
||||
Reference in New Issue
Block a user