aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/YearsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/YearsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/YearsService.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Api/UserLibrary/YearsService.cs b/MediaBrowser.Api/UserLibrary/YearsService.cs
index 8f5178ac5..8b03fb50b 100644
--- a/MediaBrowser.Api/UserLibrary/YearsService.cs
+++ b/MediaBrowser.Api/UserLibrary/YearsService.cs
@@ -114,5 +114,19 @@ namespace MediaBrowser.Api.UserLibrary
.Distinct()
.Select(year => LibraryManager.GetYear(year));
}
+
+ protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
+
+ protected override IEnumerable<BaseItem> GetLibraryItems(Year item, IEnumerable<BaseItem> libraryItems)
+ {
+ int year;
+
+ if (!int.TryParse(item.Name, NumberStyles.Integer, UsCulture, out year))
+ {
+ return libraryItems;
+ }
+
+ return libraryItems.Where(i => i.ProductionYear.HasValue && i.ProductionYear.Value == year);
+ }
}
}