feat: add caching for TVDB images (#1655)

This commit is contained in:
Gauthier
2025-05-12 10:50:24 +02:00
committed by GitHub
parent d226dbb9b4
commit e69649d71d
3 changed files with 35 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ const imageLoader: ImageLoader = ({ src }) => src;
export type CachedImageProps = ImageProps & {
src: string;
type: 'tmdb' | 'avatar';
type: 'tmdb' | 'avatar' | 'tvdb';
};
/**
@@ -22,7 +22,15 @@ const CachedImage = ({ src, type, ...props }: CachedImageProps) => {
// tmdb stuff
imageUrl =
currentSettings.cacheImages && !src.startsWith('/')
? src.replace(/^https:\/\/image\.tmdb\.org\//, '/imageproxy/')
? src.replace(/^https:\/\/image\.tmdb\.org\//, '/imageproxy/tmdb/')
: src;
} else if (type === 'tvdb') {
imageUrl =
currentSettings.cacheImages && !src.startsWith('/')
? src.replace(
/^https:\/\/artworks\.thetvdb\.com\//,
'/imageproxy/tvdb/'
)
: src;
} else if (type === 'avatar') {
// jellyfin avatar (if any)