mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-16 16:34:24 +02:00
populate bit depth from jellyfin (#1648)
This commit is contained in:
@@ -139,6 +139,7 @@ const normalizeSong = (
|
|||||||
pathReplace?: string,
|
pathReplace?: string,
|
||||||
pathReplaceWith?: string,
|
pathReplaceWith?: string,
|
||||||
): Song => {
|
): Song => {
|
||||||
|
let bitDepth: null | number = null;
|
||||||
let bitRate = 0;
|
let bitRate = 0;
|
||||||
let channels: null | number = null;
|
let channels: null | number = null;
|
||||||
let container: null | string = null;
|
let container: null | string = null;
|
||||||
@@ -156,6 +157,7 @@ const normalizeSong = (
|
|||||||
if ((source.MediaStreams?.length || 0) > 0) {
|
if ((source.MediaStreams?.length || 0) > 0) {
|
||||||
for (const stream of source.MediaStreams) {
|
for (const stream of source.MediaStreams) {
|
||||||
if (stream.Type === 'Audio') {
|
if (stream.Type === 'Audio') {
|
||||||
|
bitDepth = stream.BitDepth || null;
|
||||||
bitRate =
|
bitRate =
|
||||||
stream.BitRate !== undefined
|
stream.BitRate !== undefined
|
||||||
? Number(Math.trunc(stream.BitRate / 1000))
|
? Number(Math.trunc(stream.BitRate / 1000))
|
||||||
@@ -191,7 +193,7 @@ const normalizeSong = (
|
|||||||
albumId: item.AlbumId || `dummy/${item.Id}`,
|
albumId: item.AlbumId || `dummy/${item.Id}`,
|
||||||
artistName: item?.ArtistItems?.map((entry) => entry.Name).join(', ') || '',
|
artistName: item?.ArtistItems?.map((entry) => entry.Name).join(', ') || '',
|
||||||
artists,
|
artists,
|
||||||
bitDepth: null,
|
bitDepth,
|
||||||
bitRate,
|
bitRate,
|
||||||
bpm: null,
|
bpm: null,
|
||||||
channels,
|
channels,
|
||||||
|
|||||||
Reference in New Issue
Block a user