From e4f893a0eb955d43e7ef4c99bef8d4bfeb61a771 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Thu, 29 Aug 2019 22:28:33 +0200 Subject: More warning fixes --- .../Sorting/ArtistComparer.cs | 24 +++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'Emby.Server.Implementations/Sorting') diff --git a/Emby.Server.Implementations/Sorting/ArtistComparer.cs b/Emby.Server.Implementations/Sorting/ArtistComparer.cs index 9d5befc9a..756d3c5b6 100644 --- a/Emby.Server.Implementations/Sorting/ArtistComparer.cs +++ b/Emby.Server.Implementations/Sorting/ArtistComparer.cs @@ -7,16 +7,14 @@ using MediaBrowser.Model.Querying; namespace Emby.Server.Implementations.Sorting { /// - /// Class ArtistComparer + /// Class ArtistComparer. /// public class ArtistComparer : IBaseItemComparer { - /// - /// Compares the specified x. - /// - /// The x. - /// The y. - /// System.Int32. + /// + public string Name => ItemSortBy.Artist; + + /// public int Compare(BaseItem x, BaseItem y) { return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase); @@ -29,20 +27,12 @@ namespace Emby.Server.Implementations.Sorting /// System.String. private static string GetValue(BaseItem x) { - var audio = x as Audio; - - if (audio == null) + if (!(x is Audio audio)) { return string.Empty; } - return audio.Artists.Length == 0 ? null : audio.Artists[0]; + return audio.Artists.Count == 0 ? null : audio.Artists[0]; } - - /// - /// Gets the name. - /// - /// The name. - public string Name => ItemSortBy.Artist; } } -- cgit v1.2.3