Add AlbumNormalizationGain field to BaseItemDto

This commit is contained in:
HeroBrine1st Erquilenne
2025-09-05 00:21:20 +03:00
parent 397147d035
commit 9b00854e68
2 changed files with 15 additions and 0 deletions

View File

@@ -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))

View File

@@ -789,6 +789,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The gain required for audio normalization.</value>
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>