Browse Source

Fix album and song normalizers

master
jeffvli 3 years ago
committed by Jeff
parent
commit
c14cc83ada
  1. 10
      src/api/jellyfinApi.ts

10
src/api/jellyfinApi.ts

@ -95,13 +95,13 @@ const normalizeSong = (item: any) => {
year: item.ProductionYear,
genre: item.GenreItems && item.GenreItems.map((entry: any) => normalizeItem(entry)),
albumGenre: item.GenreItems && item.GenreItems[0]?.Name,
size: item.MediaSources && item.MediaSources.Size,
size: item.MediaSources && item.MediaSources[0]?.Size,
contentType: undefined,
suffix: undefined,
suffix: item.MediaSources && item.MediaSources[0]?.Container,
duration: item.RunTimeTicks / 10000000,
bitRate: item.MediaSources && item.MediaSources.MediaStreams?.BitRate,
bitRate: item.MediaSources && String(Math.trunc(item.MediaSources[0]?.Bitrate / 1000)),
path: item.Path,
playCount: item.UserData.PlayCount,
playCount: item.UserData && item.UserData.PlayCount,
discNumber: undefined,
created: item.DateCreated,
streamUrl: getStreamUrl(item.Id),
@ -127,7 +127,7 @@ const normalizeAlbum = (item: any) => {
genre: item.GenreItems && item.GenreItems.map((entry: any) => normalizeItem(entry)),
image: getCoverArtUrl(item, 350),
isDir: false,
starred: item.UserData.IsFavorite ? 'true' : undefined,
starred: item.UserData && item.UserData.IsFavorite ? 'true' : undefined,
type: Item.Album,
uniqueId: nanoid(),
song: (item.song || []).map((entry: any) => normalizeSong(entry)),

Loading…
Cancel
Save