aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-10-25 12:47:20 +0200
committerBond_009 <bond.009@outlook.com>2019-11-22 16:15:31 +0100
commitb477b3874ef8d79a1e27f8bb298d38443c3ec425 (patch)
tree9e2ce5032892e4c590cab63269081c413cbfdac7 /Emby.Server.Implementations/Sorting
parent7846e9cb3cce026b81509454c8128cc7ca17c2f8 (diff)
Fix some warnings
Diffstat (limited to 'Emby.Server.Implementations/Sorting')
-rw-r--r--Emby.Server.Implementations/Sorting/NameComparer.cs4
-rw-r--r--Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs4
-rw-r--r--Emby.Server.Implementations/Sorting/StudioComparer.cs5
3 files changed, 13 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Sorting/NameComparer.cs b/Emby.Server.Implementations/Sorting/NameComparer.cs
index 10fa4359a..4eb1549f5 100644
--- a/Emby.Server.Implementations/Sorting/NameComparer.cs
+++ b/Emby.Server.Implementations/Sorting/NameComparer.cs
@@ -19,10 +19,14 @@ namespace Emby.Server.Implementations.Sorting
public int Compare(BaseItem x, BaseItem y)
{
if (x == null)
+ {
throw new ArgumentNullException(nameof(x));
+ }
if (y == null)
+ {
throw new ArgumentNullException(nameof(y));
+ }
return string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase);
}
diff --git a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
index e8fa8edc8..7afbd9ff7 100644
--- a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
+++ b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
@@ -24,10 +24,14 @@ namespace Emby.Server.Implementations.Sorting
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;
diff --git a/Emby.Server.Implementations/Sorting/StudioComparer.cs b/Emby.Server.Implementations/Sorting/StudioComparer.cs
index 617ed55d5..c9ac765c1 100644
--- a/Emby.Server.Implementations/Sorting/StudioComparer.cs
+++ b/Emby.Server.Implementations/Sorting/StudioComparer.cs
@@ -17,10 +17,15 @@ namespace Emby.Server.Implementations.Sorting
public int Compare(BaseItem x, BaseItem y)
{
if (x == null)
+ {
throw new ArgumentNullException(nameof(x));
+ }
if (y == null)
+ {
throw new ArgumentNullException(nameof(y));
+ }
+
return AlphanumComparator.CompareValues(x.Studios.FirstOrDefault() ?? string.Empty, y.Studios.FirstOrDefault() ?? string.Empty);
}