parse replaygain reference loudness & album gain fields
This commit is contained in:
@@ -235,6 +235,7 @@
|
||||
- [Lampan-git](https://github.com/Lampan-git)
|
||||
- [elio42](https://github.com/elio42)
|
||||
- [rwebster85](https://github.com/rwebster85)
|
||||
- [Florin-Popescu](https://github.com/Florin-Popescu)
|
||||
|
||||
# Emby Contributors
|
||||
|
||||
|
||||
@@ -468,6 +468,24 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
}
|
||||
}
|
||||
|
||||
TryGetSanitizedAdditionalFields(track, "REPLAYGAIN_ALBUM_GAIN", out var trackAlbumGainTag);
|
||||
|
||||
if (trackAlbumGainTag is not null)
|
||||
{
|
||||
if (trackAlbumGainTag.EndsWith("db", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
trackAlbumGainTag = trackAlbumGainTag[..^2].Trim();
|
||||
}
|
||||
|
||||
if (float.TryParse(trackAlbumGainTag, NumberStyles.Float, CultureInfo.InvariantCulture, out var value) && float.IsFinite(value))
|
||||
{
|
||||
if (!audio.AlbumEntity.NormalizationGain.HasValue)
|
||||
{
|
||||
audio.AlbumEntity.NormalizationGain = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.ReplaceAllMetadata || !audio.TryGetProviderId(MetadataProvider.MusicBrainzArtist, out _))
|
||||
{
|
||||
if ((TryGetSanitizedAdditionalFields(track, "MUSICBRAINZ_ARTISTID", out var musicBrainzArtistTag)
|
||||
|
||||
Reference in New Issue
Block a user