aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-02 15:30:29 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-02 15:30:29 -0400
commited34b67f512b07ea2e97f8708811cc4150906f12 (patch)
treeb9abc36cc1a5868cb2f04e9b3d548b212a58aa0e /MediaBrowser.Server.Implementations/Sorting
parentab490d7467967c40435828bb4fc6c0066955930c (diff)
fix library scan stopping and restarting itself
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting')
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs b/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
index ef589e1fa..ffe1fc24a 100644
--- a/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
@@ -35,7 +35,14 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (x.ProductionYear.HasValue)
{
- return new DateTime(x.ProductionYear.Value, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ try
+ {
+ return new DateTime(x.ProductionYear.Value, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ }
+ catch (ArgumentOutOfRangeException)
+ {
+ // Don't blow up if the item has a bad ProductionYear, just return MinValue
+ }
}
return DateTime.MinValue;
}