Reduce size of song imageUrl

- Increase efficiency of loading times for song lists
This commit is contained in:
jeffvli 2023-01-06 01:03:58 -08:00
parent ab031820f6
commit 1b379882f5
3 changed files with 11 additions and 5 deletions

View file

@ -582,7 +582,7 @@ const getAlbumCoverArtUrl = (args: { baseUrl: string; item: JFAlbum; size: numbe
};
const getSongCoverArtUrl = (args: { baseUrl: string; item: JFSong; size: number }) => {
const size = args.size ? args.size : 300;
const size = args.size ? args.size : 100;
if (!args.item.ImageTags?.Primary) {
return null;
@ -652,7 +652,7 @@ const normalizeSong = (
genres: item.GenreItems.map((entry: any) => ({ id: entry.Id, name: entry.Name })),
id: item.Id,
imagePlaceholderUrl: null,
imageUrl: getSongCoverArtUrl({ baseUrl: server.url, item, size: imageSize || 300 }),
imageUrl: getSongCoverArtUrl({ baseUrl: server.url, item, size: imageSize || 100 }),
itemType: LibraryItem.SONG,
lastPlayedAt: null,
name: item.Name,

View file

@ -503,7 +503,7 @@ const normalizeSong = (
baseUrl: server.url,
coverArtId: id,
credential: server.credential,
size: imageSize || 300,
size: imageSize || 100,
});
const imagePlaceholderUrl = null;