diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-20 11:48:23 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-20 11:48:23 -0400 |
| commit | f6769b73f2a82273e67689e8bc1c9d7b005ee866 (patch) | |
| tree | a8a947f475e47632e61d0b91f421faa245f7198a /MediaBrowser.Api/UserLibrary | |
| parent | ab207209b8138dccfea82d0fcd39866ff7e2fe9c (diff) | |
add MediaInfo to improve media analysis for video files
Diffstat (limited to 'MediaBrowser.Api/UserLibrary')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ItemsService.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/UserLibraryService.cs | 29 |
2 files changed, 14 insertions, 26 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 25821c213..2ac4f5e63 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -1008,7 +1008,7 @@ namespace MediaBrowser.Api.UserLibrary items = items.Where(i => { - var movie = i as Movie; + var movie = i as IHasSpecialFeatures; if (movie != null) { @@ -1017,15 +1017,6 @@ namespace MediaBrowser.Api.UserLibrary : movie.SpecialFeatureIds.Count == 0; } - var series = i as Series; - - if (series != null) - { - return filterValue - ? series.SpecialFeatureIds.Count > 0 - : series.SpecialFeatureIds.Count == 0; - } - return false; }); } diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index 8414241d5..b156b68d1 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -443,22 +443,6 @@ namespace MediaBrowser.Api.UserLibrary // Get everything var fields = Enum.GetNames(typeof(ItemFields)).Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true)).ToList(); - var movie = item as Movie; - - // Get them from the db - if (movie != null) - { - // Avoid implicitly captured closure - var movie1 = movie; - - var dtos = movie.SpecialFeatureIds - .Select(_libraryManager.GetItemById) - .OrderBy(i => i.SortName) - .Select(i => _dtoService.GetBaseItemDto(i, fields, user, movie1)); - - return dtos.ToList(); - } - var series = item as Series; // Get them from the child tree @@ -486,6 +470,19 @@ namespace MediaBrowser.Api.UserLibrary return dtos.ToList(); } + var movie = item as IHasSpecialFeatures; + + // Get them from the db + if (movie != null) + { + var dtos = movie.SpecialFeatureIds + .Select(_libraryManager.GetItemById) + .OrderBy(i => i.SortName) + .Select(i => _dtoService.GetBaseItemDto(i, fields, user, item)); + + return dtos.ToList(); + } + return new List<BaseItemDto>(); } |
