add track normalization for jellyfin as well

This commit is contained in:
Kendall Garner
2024-09-09 07:15:26 -07:00
parent fcc010eb54
commit e2a05f4204
2 changed files with 11 additions and 5 deletions
@@ -153,11 +153,16 @@ const normalizeSong = (
discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1, discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1,
discSubtitle: null, discSubtitle: null,
duration: item.RunTimeTicks / 10000, duration: item.RunTimeTicks / 10000,
gain: item.LUFS gain:
? { item.NormalizationGain !== undefined
track: -18 - item.LUFS, ? {
} track: item.NormalizationGain,
: null, }
: item.LUFS
? {
track: -18 - item.LUFS,
}
: null,
genres: item.GenreItems?.map((entry) => ({ genres: item.GenreItems?.map((entry) => ({
id: entry.Id, id: entry.Id,
imageUrl: null, imageUrl: null,
@@ -413,6 +413,7 @@ const song = z.object({
MediaSources: z.array(mediaSources), MediaSources: z.array(mediaSources),
MediaType: z.string(), MediaType: z.string(),
Name: z.string(), Name: z.string(),
NormalizationGain: z.number().optional(),
ParentIndexNumber: z.number(), ParentIndexNumber: z.number(),
PlaylistItemId: z.string().optional(), PlaylistItemId: z.string().optional(),
PremiereDate: z.string().optional(), PremiereDate: z.string().optional(),