aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-20 16:08:12 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-20 16:08:12 -0500
commit71514af96be684dcbf432c5aca37712bbd773740 (patch)
tree9773616e9f3c34a56590a5525960214cf7cc1ca7 /MediaBrowser.Server.Implementations/Sorting
parentc3530e5e3255d2c2e8ec5fa4bc4635a21904235e (diff)
render channels page
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting')
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
index cec9743ba..23334aa41 100644
--- a/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
@@ -1,8 +1,8 @@
-using System;
-using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
+using System;
namespace MediaBrowser.Server.Implementations.Sorting
{
@@ -16,11 +16,14 @@ namespace MediaBrowser.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
- var val = DateTime.Compare(x.PremiereDate ?? DateTime.MinValue, y.PremiereDate ?? DateTime.MinValue);
-
- if (val != 0)
+ if (x.PremiereDate.HasValue && y.PremiereDate.HasValue)
{
- return val;
+ var val = DateTime.Compare(x.PremiereDate.Value, y.PremiereDate.Value);
+
+ if (val != 0)
+ {
+ return val;
+ }
}
var episode1 = x as Episode;