فهرست منبع

fixed year selection issue

Luke Pulverenti 11 سال پیش
والد
کامیت
266498f92c
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 2 1
      MediaBrowser.Api/UserLibrary/YearsService.cs
  2. 1 1
      MediaBrowser.Server.Implementations/Library/LibraryManager.cs

+ 2 - 1
MediaBrowser.Api/UserLibrary/YearsService.cs

@@ -110,7 +110,8 @@ namespace MediaBrowser.Api.UserLibrary
             var itemsList = items.Where(i => i.ProductionYear != null).ToList();
             var itemsList = items.Where(i => i.ProductionYear != null).ToList();
 
 
             return itemsList
             return itemsList
-                .Select(i => i.ProductionYear.Value)
+                .Select(i => i.ProductionYear ?? 0)
+                .Where(i => i > 0)
                 .Distinct()
                 .Distinct()
                 .Select(year => LibraryManager.GetYear(year));
                 .Select(year => LibraryManager.GetYear(year));
         }
         }

+ 1 - 1
MediaBrowser.Server.Implementations/Library/LibraryManager.cs

@@ -703,7 +703,7 @@ namespace MediaBrowser.Server.Implementations.Library
         {
         {
             if (value <= 0)
             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));
             return GetItemByName<Year>(ConfigurationManager.ApplicationPaths.YearPath, value.ToString(UsCulture));