Fix conditionals on jellyfin normalization
This commit is contained in:
parent
a1072b461f
commit
5637327e8a
1 changed files with 9 additions and 5 deletions
|
@ -134,8 +134,12 @@ const normalizeSong = (
|
||||||
name: entry.Name,
|
name: entry.Name,
|
||||||
})),
|
})),
|
||||||
albumId: item.AlbumId,
|
albumId: item.AlbumId,
|
||||||
artistName: item.ArtistItems[0]?.Name,
|
artistName: item?.ArtistItems?.[0]?.Name,
|
||||||
artists: item.ArtistItems.map((entry) => ({ id: entry.Id, imageUrl: null, name: entry.Name })),
|
artists: item?.ArtistItems?.map((entry) => ({
|
||||||
|
id: entry.Id,
|
||||||
|
imageUrl: null,
|
||||||
|
name: entry.Name,
|
||||||
|
})),
|
||||||
bitRate: item.MediaSources && Number(Math.trunc(item.MediaSources[0]?.Bitrate / 1000)),
|
bitRate: item.MediaSources && Number(Math.trunc(item.MediaSources[0]?.Bitrate / 1000)),
|
||||||
bpm: null,
|
bpm: null,
|
||||||
channels: null,
|
channels: null,
|
||||||
|
@ -162,11 +166,11 @@ const normalizeSong = (
|
||||||
serverType: ServerType.JELLYFIN,
|
serverType: ServerType.JELLYFIN,
|
||||||
size: item.MediaSources && item.MediaSources[0]?.Size,
|
size: item.MediaSources && item.MediaSources[0]?.Size,
|
||||||
streamUrl: getStreamUrl({
|
streamUrl: getStreamUrl({
|
||||||
container: item.MediaSources[0]?.Container,
|
container: item.MediaSources?.[0]?.Container,
|
||||||
deviceId,
|
deviceId,
|
||||||
eTag: item.MediaSources[0]?.ETag,
|
eTag: item.MediaSources?.[0]?.ETag,
|
||||||
id: item.Id,
|
id: item.Id,
|
||||||
mediaSourceId: item.MediaSources[0]?.Id,
|
mediaSourceId: item.MediaSources?.[0]?.Id,
|
||||||
server,
|
server,
|
||||||
}),
|
}),
|
||||||
trackNumber: item.IndexNumber,
|
trackNumber: item.IndexNumber,
|
||||||
|
|
Reference in a new issue