diff options
Diffstat (limited to 'MediaBrowser.Providers/MediaInfo/AudioFileProber.cs')
| -rw-r--r-- | MediaBrowser.Providers/MediaInfo/AudioFileProber.cs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs index 45e8553ea..c0680b901 100644 --- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs +++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs @@ -192,7 +192,20 @@ namespace MediaBrowser.Providers.MediaInfo if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast)) { var people = new List<PersonInfo>(); - var albumArtists = string.IsNullOrEmpty(trackAlbumArtist) ? [] : trackAlbumArtist.Split(InternalValueSeparator); + string[]? albumArtists = null; + if (libraryOptions.PreferNonstandardArtistsTag) + { + TryGetSanitizedAdditionalFields(track, "ALBUMARTISTS", out var albumArtistsTagString); + if (albumArtistsTagString is not null) + { + albumArtists = albumArtistsTagString.Split(InternalValueSeparator); + } + } + + if (albumArtists is null || albumArtists.Length == 0) + { + albumArtists = string.IsNullOrEmpty(trackAlbumArtist) ? [] : trackAlbumArtist.Split(InternalValueSeparator); + } if (libraryOptions.UseCustomTagDelimiters) { @@ -205,7 +218,7 @@ namespace MediaBrowser.Providers.MediaInfo { PeopleHelper.AddPerson(people, new PersonInfo { - Name = albumArtist.Trim(), + Name = albumArtist, Type = PersonKind.AlbumArtist }); } @@ -237,7 +250,7 @@ namespace MediaBrowser.Providers.MediaInfo { PeopleHelper.AddPerson(people, new PersonInfo { - Name = performer.Trim(), + Name = performer, Type = PersonKind.Artist }); } @@ -251,7 +264,7 @@ namespace MediaBrowser.Providers.MediaInfo { PeopleHelper.AddPerson(people, new PersonInfo { - Name = composer.Trim(), + Name = composer, Type = PersonKind.Composer }); } @@ -436,7 +449,11 @@ namespace MediaBrowser.Providers.MediaInfo // Save extracted lyrics if they exist, // and if the audio doesn't yet have lyrics. - var lyrics = track.Lyrics.SynchronizedLyrics.Count > 0 ? track.Lyrics.FormatSynchToLRC() : track.Lyrics.UnsynchronizedLyrics; + // ATL supports both SRT and LRC formats as synchronized lyrics, but we only want to save LRC format. + var supportedLyrics = track.Lyrics.Where(l => l.Format != LyricsInfo.LyricsFormat.SRT).ToList(); + var candidateSynchronizedLyric = supportedLyrics.FirstOrDefault(l => l.Format is not LyricsInfo.LyricsFormat.UNSYNCHRONIZED and not LyricsInfo.LyricsFormat.OTHER && l.SynchronizedLyrics is not null); + var candidateUnsynchronizedLyric = supportedLyrics.FirstOrDefault(l => l.Format is LyricsInfo.LyricsFormat.UNSYNCHRONIZED or LyricsInfo.LyricsFormat.OTHER && l.UnsynchronizedLyrics is not null); + var lyrics = candidateSynchronizedLyric is not null ? candidateSynchronizedLyric.FormatSynch() : candidateUnsynchronizedLyric?.UnsynchronizedLyrics; if (!string.IsNullOrWhiteSpace(lyrics) && tryExtractEmbeddedLyrics) { |
