Apply review suggestions

This commit is contained in:
Shadowghost 2022-10-07 14:14:21 +02:00
parent a97ec65227
commit 6c6f89acc3
2 changed files with 5 additions and 7 deletions

View File

@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
/// </summary> /// </summary>
/// <param name="path">The path to check.</param> /// <param name="path">The path to check.</param>
/// <param name="directoryService">The directory service.</param> /// <param name="directoryService">The directory service.</param>
/// <returns><c>true</c> if the provided path points to a music album, <c>false</c> otherwise.</returns> /// <returns><c>true</c> if the provided path points to a music album; otherwise, <c>false</c>.</returns>
public bool IsMusicAlbum(string path, IDirectoryService directoryService) public bool IsMusicAlbum(string path, IDirectoryService directoryService)
{ {
return ContainsMusic(directoryService.GetFileSystemEntries(path), true, 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. /// Determine if the supplied resolve args should be considered a music album.
/// </summary> /// </summary>
/// <param name="args">The args.</param> /// <param name="args">The args.</param>
/// <returns><c>true</c> if [is music album] [the specified args], <c>false</c> otherwise.</returns> /// <returns><c>true</c> if [is music album] [the specified args]; otherwise, <c>false</c>.</returns>
private bool IsMusicAlbum(ItemResolveArgs args) private bool IsMusicAlbum(ItemResolveArgs args)
{ {
if (args.IsDirectory) if (args.IsDirectory)
@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
/// <summary> /// <summary>
/// Determine if the supplied list contains what we should consider music. /// Determine if the supplied list contains what we should consider music.
/// </summary> /// </summary>
/// <returns><c>true</c> if the provided path list contains music, <c>false</c> otherwise.</returns> /// <returns><c>true</c> if the provided path list contains music; otherwise, <c>false</c>.</returns>
private bool ContainsMusic( private bool ContainsMusic(
ICollection<FileSystemMetadata> list, ICollection<FileSystemMetadata> list,
bool allowSubfolders, bool allowSubfolders,

View File

@ -1,5 +1,3 @@
#nullable disable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -120,7 +118,7 @@ namespace MediaBrowser.Providers.MediaInfo
{ {
var file = TagLib.File.Create(audio.Path); var file = TagLib.File.Create(audio.Path);
var tagTypes = file.TagTypesOnDisk; var tagTypes = file.TagTypesOnDisk;
Tag tags = null; Tag tags = new TagLib.Id3v2.Tag();
if (tagTypes.HasFlag(TagTypes.Id3v2)) if (tagTypes.HasFlag(TagTypes.Id3v2))
{ {
@ -151,7 +149,7 @@ namespace MediaBrowser.Providers.MediaInfo
tags = file.GetTag(TagTypes.Id3v1); tags = file.GetTag(TagTypes.Id3v1);
} }
if (tags != null) if (tags.IsEmpty)
{ {
if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast)) if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast))
{ {