mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
add Navidrome/Jellyfin image cache invalidation
This commit is contained in:
parent
eea36f720a
commit
2feef206fb
3 changed files with 13 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ const getCoverArtUrl = (args: {
|
|||
coverArtId: string;
|
||||
credential: string | undefined;
|
||||
size: number;
|
||||
updated: string;
|
||||
}) => {
|
||||
const size = args.size ? args.size : 250;
|
||||
|
||||
|
|
@ -43,7 +44,10 @@ const getCoverArtUrl = (args: {
|
|||
`&${args.credential}` +
|
||||
'&v=1.13.0' +
|
||||
'&c=Feishin' +
|
||||
`&size=${size}`
|
||||
`&size=${size}` +
|
||||
// A dummy variable to invalidate the cached image if the item is updated
|
||||
// This is adapted from how Navidrome web does it
|
||||
`&_=${args.updated}`
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -140,6 +144,7 @@ const normalizeSong = (
|
|||
coverArtId: id,
|
||||
credential: server?.credential,
|
||||
size: imageSize || 100,
|
||||
updated: item.updatedAt,
|
||||
});
|
||||
|
||||
const imagePlaceholderUrl = null;
|
||||
|
|
@ -216,6 +221,7 @@ const normalizeAlbum = (
|
|||
coverArtId: item.coverArtId || item.id,
|
||||
credential: server?.credential,
|
||||
size: imageSize || 300,
|
||||
updated: item.updatedAt,
|
||||
});
|
||||
|
||||
const imagePlaceholderUrl = null;
|
||||
|
|
@ -282,6 +288,7 @@ const normalizeAlbumArtist = (
|
|||
coverArtId: `ar-${item.id}`,
|
||||
credential: server?.credential,
|
||||
size: 300,
|
||||
updated: item.updatedAt || '',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -344,6 +351,7 @@ const normalizePlaylist = (
|
|||
coverArtId: item.id,
|
||||
credential: server?.credential,
|
||||
size: imageSize || 300,
|
||||
updated: item.updatedAt,
|
||||
});
|
||||
|
||||
const imagePlaceholderUrl = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue