mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13: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
|
|
@ -88,7 +88,8 @@ const getSongCoverArtUrl = (args: {
|
||||||
`/${args.item.Id}` +
|
`/${args.item.Id}` +
|
||||||
'/Images/Primary' +
|
'/Images/Primary' +
|
||||||
`?width=${size}` +
|
`?width=${size}` +
|
||||||
'&quality=96'
|
'&quality=96' +
|
||||||
|
`&tag=${args.item.ImageTags.Primary}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ const getCoverArtUrl = (args: {
|
||||||
coverArtId: string;
|
coverArtId: string;
|
||||||
credential: string | undefined;
|
credential: string | undefined;
|
||||||
size: number;
|
size: number;
|
||||||
|
updated: string;
|
||||||
}) => {
|
}) => {
|
||||||
const size = args.size ? args.size : 250;
|
const size = args.size ? args.size : 250;
|
||||||
|
|
||||||
|
|
@ -43,7 +44,10 @@ const getCoverArtUrl = (args: {
|
||||||
`&${args.credential}` +
|
`&${args.credential}` +
|
||||||
'&v=1.13.0' +
|
'&v=1.13.0' +
|
||||||
'&c=Feishin' +
|
'&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,
|
coverArtId: id,
|
||||||
credential: server?.credential,
|
credential: server?.credential,
|
||||||
size: imageSize || 100,
|
size: imageSize || 100,
|
||||||
|
updated: item.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
const imagePlaceholderUrl = null;
|
const imagePlaceholderUrl = null;
|
||||||
|
|
@ -216,6 +221,7 @@ const normalizeAlbum = (
|
||||||
coverArtId: item.coverArtId || item.id,
|
coverArtId: item.coverArtId || item.id,
|
||||||
credential: server?.credential,
|
credential: server?.credential,
|
||||||
size: imageSize || 300,
|
size: imageSize || 300,
|
||||||
|
updated: item.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
const imagePlaceholderUrl = null;
|
const imagePlaceholderUrl = null;
|
||||||
|
|
@ -282,6 +288,7 @@ const normalizeAlbumArtist = (
|
||||||
coverArtId: `ar-${item.id}`,
|
coverArtId: `ar-${item.id}`,
|
||||||
credential: server?.credential,
|
credential: server?.credential,
|
||||||
size: 300,
|
size: 300,
|
||||||
|
updated: item.updatedAt || '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -344,6 +351,7 @@ const normalizePlaylist = (
|
||||||
coverArtId: item.id,
|
coverArtId: item.id,
|
||||||
credential: server?.credential,
|
credential: server?.credential,
|
||||||
size: imageSize || 300,
|
size: imageSize || 300,
|
||||||
|
updated: item.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
const imagePlaceholderUrl = null;
|
const imagePlaceholderUrl = null;
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ const stats = z.object({
|
||||||
const albumArtist = z.object({
|
const albumArtist = z.object({
|
||||||
albumCount: z.number(),
|
albumCount: z.number(),
|
||||||
biography: z.string(),
|
biography: z.string(),
|
||||||
|
createdAt: z.string().optional(),
|
||||||
externalInfoUpdatedAt: z.string(),
|
externalInfoUpdatedAt: z.string(),
|
||||||
externalUrl: z.string(),
|
externalUrl: z.string(),
|
||||||
fullText: z.string(),
|
fullText: z.string(),
|
||||||
|
|
@ -99,6 +100,7 @@ const albumArtist = z.object({
|
||||||
starred: z.boolean(),
|
starred: z.boolean(),
|
||||||
starredAt: z.string(),
|
starredAt: z.string(),
|
||||||
stats: z.record(z.string(), stats).optional(),
|
stats: z.record(z.string(), stats).optional(),
|
||||||
|
updatedAt: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const albumArtistList = z.array(albumArtist);
|
const albumArtistList = z.array(albumArtist);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue