diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-04-05 16:38:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-05 16:38:35 +0200 |
| commit | 9bf04df5d9818fcece3282035ef7ff7c52646c71 (patch) | |
| tree | a50284e7f7debad770cb7b44b37a80f931111539 | |
| parent | 7f3e27c0075bdbcad6ebd4dd77184cb9ce99b6e0 (diff) | |
| parent | 9b00854e686c65ef4b0578071e5e2a4d9083181a (diff) | |
Merge pull request #14745 from HeroBrine1st/master
Add AlbumNormalizationGain field to BaseItemDto
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dto/BaseItemDto.cs | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index b392340f71..08ced387b8 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1019,6 +1019,15 @@ namespace Emby.Server.Implementations.Dto { dto.AlbumId = albumParent.Id; dto.AlbumPrimaryImageTag = GetTagAndFillBlurhash(dto, albumParent, ImageType.Primary); + if (albumParent.LUFS.HasValue) + { + // -18 LUFS reference, same as ReplayGain 2.0, compatible with ReplayGain 1.0 + dto.AlbumNormalizationGain = -18f - albumParent.LUFS; + } + else if (albumParent.NormalizationGain.HasValue) + { + dto.AlbumNormalizationGain = albumParent.NormalizationGain; + } } // if (options.ContainsField(ItemFields.MediaSourceCount)) diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 8f223c12a5..e96bba0464 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -790,6 +790,12 @@ namespace MediaBrowser.Model.Dto public float? NormalizationGain { get; set; } /// <summary> + /// Gets or sets the gain required for audio normalization. This field is inherited from music album normalization gain. + /// </summary> + /// <value>The gain required for audio normalization.</value> + public float? AlbumNormalizationGain { get; set; } + + /// <summary> /// Gets or sets the current program. /// </summary> /// <value>The current program.</value> |
