From 6c6f89acc306f2dd9237ce618f024f8630f70696 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 7 Oct 2022 14:14:21 +0200 Subject: [PATCH] Apply review suggestions --- .../Library/Resolvers/Audio/MusicAlbumResolver.cs | 6 +++--- MediaBrowser.Providers/MediaInfo/AudioFileProber.cs | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index 2674d13559..a922e36855 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// /// The path to check. /// The directory service. - /// true if the provided path points to a music album, false otherwise. + /// true if the provided path points to a music album; otherwise, false. public bool IsMusicAlbum(string path, IDirectoryService directoryService) { return ContainsMusic(directoryService.GetFileSystemEntries(path), true, directoryService); @@ -93,7 +93,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// Determine if the supplied resolve args should be considered a music album. /// /// The args. - /// true if [is music album] [the specified args], false otherwise. + /// true if [is music album] [the specified args]; otherwise, false. private bool IsMusicAlbum(ItemResolveArgs args) { if (args.IsDirectory) @@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// /// Determine if the supplied list contains what we should consider music. /// - /// true if the provided path list contains music, false otherwise. + /// true if the provided path list contains music; otherwise, false. private bool ContainsMusic( ICollection list, bool allowSubfolders, diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs index 42d85bb0cf..7f8ecd5784 100644 --- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs +++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; using System.Collections.Generic; using System.Linq; @@ -120,7 +118,7 @@ namespace MediaBrowser.Providers.MediaInfo { var file = TagLib.File.Create(audio.Path); var tagTypes = file.TagTypesOnDisk; - Tag tags = null; + Tag tags = new TagLib.Id3v2.Tag(); if (tagTypes.HasFlag(TagTypes.Id3v2)) { @@ -151,7 +149,7 @@ namespace MediaBrowser.Providers.MediaInfo tags = file.GetTag(TagTypes.Id3v1); } - if (tags != null) + if (tags.IsEmpty) { if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast)) {