populate bit depth from jellyfin (#1648)

This commit is contained in:
Jake Klingler
2026-02-04 03:10:28 -05:00
committed by GitHub
parent 2b6b0cb38b
commit 3518a3f3b6
@@ -139,6 +139,7 @@ const normalizeSong = (
pathReplace?: string,
pathReplaceWith?: string,
): Song => {
let bitDepth: null | number = null;
let bitRate = 0;
let channels: null | number = null;
let container: null | string = null;
@@ -156,6 +157,7 @@ const normalizeSong = (
if ((source.MediaStreams?.length || 0) > 0) {
for (const stream of source.MediaStreams) {
if (stream.Type === 'Audio') {
bitDepth = stream.BitDepth || null;
bitRate =
stream.BitRate !== undefined
? Number(Math.trunc(stream.BitRate / 1000))
@@ -191,7 +193,7 @@ const normalizeSong = (
albumId: item.AlbumId || `dummy/${item.Id}`,
artistName: item?.ArtistItems?.map((entry) => entry.Name).join(', ') || '',
artists,
bitDepth: null,
bitDepth,
bitRate,
bpm: null,
channels,