fix library scan stopping and restarting itself

This commit is contained in:
Luke Pulverenti
2013-11-02 15:30:29 -04:00
parent ab490d7467
commit ed34b67f51
13 changed files with 77 additions and 19 deletions

View File

@@ -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;
}