refactor: streamline ClientLayout and PreferencesContext for improved state management and debugging
This commit is contained in:
11
src/lib/utils/image-url.ts
Normal file
11
src/lib/utils/image-url.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Génère l'URL de base pour une image (sans cache version)
|
||||
* Utilisez useImageUrl() dans les composants pour obtenir l'URL avec cache busting
|
||||
*/
|
||||
export function getImageUrl(type: "series" | "book", id: string) {
|
||||
if (type === "series") {
|
||||
return `/api/komga/images/series/${id}/thumbnail`;
|
||||
}
|
||||
return `/api/komga/images/books/${id}/thumbnail`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user