aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-16 12:56:50 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-16 12:56:50 -0500
commit266498f92cc9a75527a95fe4e401b67f5e3b5b42 (patch)
treeb3b43d84c975b4988d0f2b66785148e6e1ae88a7
parentb4690123049a70a11101b27af6baaee3572d1549 (diff)
fixed year selection issue
-rw-r--r--MediaBrowser.Api/UserLibrary/YearsService.cs3
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs2
2 files changed, 3 insertions, 2 deletions
diff --git a/MediaBrowser.Api/UserLibrary/YearsService.cs b/MediaBrowser.Api/UserLibrary/YearsService.cs
index 8b03fb50b..3c54d5b36 100644
--- a/MediaBrowser.Api/UserLibrary/YearsService.cs
+++ b/MediaBrowser.Api/UserLibrary/YearsService.cs
@@ -110,7 +110,8 @@ namespace MediaBrowser.Api.UserLibrary
var itemsList = items.Where(i => i.ProductionYear != null).ToList();
return itemsList
- .Select(i => i.ProductionYear.Value)
+ .Select(i => i.ProductionYear ?? 0)
+ .Where(i => i > 0)
.Distinct()
.Select(year => LibraryManager.GetYear(year));
}
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index fc5497fa3..736c70ad5 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -703,7 +703,7 @@ namespace MediaBrowser.Server.Implementations.Library
{
if (value <= 0)
{
- throw new ArgumentOutOfRangeException();
+ throw new ArgumentOutOfRangeException("Years less than or equal to 0 are invalid.");
}
return GetItemByName<Year>(ConfigurationManager.ApplicationPaths.YearPath, value.ToString(UsCulture));