From ac9322370b441d26fa040e91d1774df6628fce88 Mon Sep 17 00:00:00 2001 From: gnattu Date: Thu, 30 May 2024 18:59:26 +0800 Subject: [PATCH] Check if the metadata is supported for title fallback Signed-off-by: gnattu --- MediaBrowser.Providers/MediaInfo/AudioFileProber.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs index 1e7ec36e5..7a1d04b3a 100644 --- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs +++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs @@ -159,8 +159,13 @@ namespace MediaBrowser.Providers.MediaInfo ATL.Settings.DisplayValueSeparator = '\u001F'; Track track = new Track(audio.Path); + // ATL will fall back to filename as title when it does not understand the metadata + if (track.MetadataFormats.All(mf => mf.Equals(ATL.Factory.UNKNOWN_FORMAT))) + { + track.Title = mediaInfo.Name; + } + track.Album = string.IsNullOrEmpty(track.Album) ? mediaInfo.Album : track.Album; - track.Title = string.IsNullOrEmpty(track.Title) ? mediaInfo.Name : track.Title; track.Year ??= mediaInfo.ProductionYear; track.TrackNumber ??= mediaInfo.IndexNumber; track.DiscNumber ??= mediaInfo.ParentIndexNumber;