diff options
| author | TelepathicWalrus <48514138+TelepathicWalrus@users.noreply.github.com> | 2023-08-18 09:25:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-18 10:25:56 +0200 |
| commit | 4c7fb8f45268c0123d0488dab23dff00c9578257 (patch) | |
| tree | c2c418b8734fb5a2f43f185fbd98b4ca367a8895 | |
| parent | da030ed58931ba9147899ffa9ee99524c637473d (diff) | |
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
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7a6ed2cb8..6d27703bd 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 2dbd513a1..237345206 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<Audio>().Max(item => item.LUFS); + var parentRefreshOptions = refreshOptions; if (childUpdateType > ItemUpdateType.None) { |
