refactor(imageproxy): reduce noisy image cache logging (#2789)

This commit is contained in:
fallenbagel
2026-04-01 20:40:14 +08:00
committed by GitHub
parent 4434c45ea7
commit 036d000f26
2 changed files with 15 additions and 16 deletions

View File

@@ -55,16 +55,12 @@ class ImageProxy {
} }
} catch (e) { } catch (e) {
if (e.code === 'ENOENT') { if (e.code === 'ENOENT') {
logger.error('Directory not found', { return;
label: 'Image Cache',
message: e.message,
});
} else {
logger.error('Failed to read directory', {
label: 'Image Cache',
message: e.message,
});
} }
logger.error('Failed to read directory', {
label: 'Image Cache',
message: e.message,
});
} }
logger.info(`Cleared ${deletedImages} stale image(s) from cache '${key}'`, { logger.info(`Cleared ${deletedImages} stale image(s) from cache '${key}'`, {

View File

@@ -141,13 +141,16 @@ router.get('/:jellyfinUserId', async (req, res) => {
const jellyfinAvatarUrl = getJellyfinAvatarUrl(req.params.jellyfinUserId); const jellyfinAvatarUrl = getJellyfinAvatarUrl(req.params.jellyfinUserId);
let imageData = await avatarImageCache.getImage( let imageData;
jellyfinAvatarUrl, if (user?.avatarVersion) {
fallbackUrl imageData = await avatarImageCache.getImage(
); jellyfinAvatarUrl,
fallbackUrl
if (imageData.meta.extension === 'json') { );
// this is a 404 if (imageData.meta.extension === 'json') {
imageData = await avatarImageCache.getImage(fallbackUrl);
}
} else {
imageData = await avatarImageCache.getImage(fallbackUrl); imageData = await avatarImageCache.getImage(fallbackUrl);
} }