aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs')
-rw-r--r--Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
index 3eab4fccc..e8fa8edc8 100644
--- a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
+++ b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Entities;
+using System;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Querying;
@@ -22,6 +23,12 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
+ if (x == null)
+ throw new ArgumentNullException(nameof(x));
+
+ if (y == null)
+ throw new ArgumentNullException(nameof(y));
+
var levelX = string.IsNullOrEmpty(x.OfficialRating) ? 0 : _localization.GetRatingLevel(x.OfficialRating) ?? 0;
var levelY = string.IsNullOrEmpty(y.OfficialRating) ? 0 : _localization.GetRatingLevel(y.OfficialRating) ?? 0;
@@ -32,9 +39,6 @@ namespace Emby.Server.Implementations.Sorting
/// Gets the name.
/// </summary>
/// <value>The name.</value>
- public string Name
- {
- get { return ItemSortBy.OfficialRating; }
- }
+ public string Name => ItemSortBy.OfficialRating;
}
}