From 4c7fb8f45268c0123d0488dab23dff00c9578257 Mon Sep 17 00:00:00 2001 From: TelepathicWalrus <48514138+TelepathicWalrus@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:25:56 +0100 Subject: [PATCH] Album gain (#10085) * Add LUFSAlbum DTO * Get loudest track for smallest gain * Move gain search to musicalbum use baseitem LUFS for album * Use .Max for enumerable * Update DTO to be consistent with other DTOs * Remove albumlufs, Move dto for all types --- Emby.Server.Implementations/Dto/DtoService.cs | 3 ++- MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7a6ed2cb80..6d27703bdc 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -903,10 +903,11 @@ namespace Emby.Server.Implementations.Dto dto.IsPlaceHolder = supportsPlaceHolders.IsPlaceHolder; } + dto.LUFS = item.LUFS; + // Add audio info if (item is Audio audio) { - dto.LUFS = audio.LUFS; dto.Album = audio.Album; if (audio.ExtraType.HasValue) { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index 2dbd513a17..237345206f 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -183,6 +183,9 @@ namespace MediaBrowser.Controller.Entities.Audio progress.Report(percent * 95); } + // get album LUFS + LUFS = items.OfType