aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorAnthony Lavado <anthonylavado@users.noreply.github.com>2019-09-02 02:07:19 -0400
committerGitHub <noreply@github.com>2019-09-02 02:07:19 -0400
commitcb393c215a2ea75f61d0e3e798c6a4a596d720c2 (patch)
tree1eb9586e139de7af8cc906ca4aa758e5106cb35d /Emby.Server.Implementations/Sorting
parentc4eac8b3c6257e4a2aab2fa93d877fbcff8fee51 (diff)
parente4f893a0eb955d43e7ef4c99bef8d4bfeb61a771 (diff)
Merge pull request #1686 from Bond-009/warn7
More warning fixes
Diffstat (limited to 'Emby.Server.Implementations/Sorting')
-rw-r--r--Emby.Server.Implementations/Sorting/ArtistComparer.cs24
1 files changed, 7 insertions, 17 deletions
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
{
/// <summary>
- /// Class ArtistComparer
+ /// Class ArtistComparer.
/// </summary>
public class ArtistComparer : IBaseItemComparer
{
- /// <summary>
- /// Compares the specified x.
- /// </summary>
- /// <param name="x">The x.</param>
- /// <param name="y">The y.</param>
- /// <returns>System.Int32.</returns>
+ /// <inheritdoc />
+ public string Name => ItemSortBy.Artist;
+
+ /// <inheritdoc />
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
/// <returns>System.String.</returns>
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];
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.Artist;
}
}