many changes
Traceability Validation / Check Requirement Traces (push) Failing after 1m18s
🏗️ Build and Test JellyTau / Build APK and Run Tests (push) Has been cancelled

This commit is contained in:
2026-02-14 00:09:47 +01:00
parent 6d1c618a3a
commit e3797f32ca
74 changed files with 6718 additions and 771 deletions
+1 -46
View File
@@ -1,4 +1,5 @@
// Image cache service - Handles lazy caching of thumbnails with LRU eviction
// TRACES: UR-007 | DR-016
import { invoke } from "@tauri-apps/api/core";
import { convertFileSrc } from "@tauri-apps/api/core";
@@ -75,52 +76,6 @@ export async function getCachedImageUrl(
return serverImageUrl;
}
/**
* Synchronous version that returns server URL immediately
* and triggers background caching. Useful for initial render.
*
* @param serverUrl - The Jellyfin server base URL
* @param itemId - The Jellyfin item ID
* @param imageType - The image type (Primary, Backdrop, etc.)
* @param options - Image options
* @returns The server image URL
*/
export function getImageUrlSync(
serverUrl: string,
itemId: string,
imageType: string = "Primary",
options: {
maxWidth?: number;
maxHeight?: number;
quality?: number;
tag?: string;
} = {}
): string {
const tag = options.tag || "default";
// Build server URL
const params = new URLSearchParams();
if (options.maxWidth) params.set("maxWidth", options.maxWidth.toString());
if (options.maxHeight) params.set("maxHeight", options.maxHeight.toString());
if (options.quality) params.set("quality", options.quality.toString());
if (options.tag) params.set("tag", options.tag);
const serverImageUrl = `${serverUrl}/Items/${itemId}/Images/${imageType}?${params.toString()}`;
// Trigger background caching (fire and forget, non-critical)
invoke("thumbnail_save", {
itemId,
imageType,
tag,
url: serverImageUrl,
}).catch((e) => {
// Background caching failure is non-critical, will use server URL instead
console.debug(`[imageCache] Failed to save thumbnail for ${itemId}:`, e);
});
return serverImageUrl;
}
/**
* Get thumbnail cache statistics
*/