diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-06-11 18:05:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-11 18:05:07 -0400 |
| commit | e0c907cc6009408157d42531afab4c089c2e2871 (patch) | |
| tree | 069efdd6b11b3dd81e7bc6c191497114374f0577 /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | 9ee58d399cde4ccec9ea10c60c1a508a353b7836 (diff) | |
| parent | e9d2fb13e06a93336b6b16d03b66d3390a762c40 (diff) | |
Merge pull request #2702 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 4e0bdc8a9..d9fc7143f 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -27,6 +27,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.IO; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Services; +using MediaBrowser.Common.Extensions; namespace MediaBrowser.Api.Library { @@ -675,7 +676,6 @@ namespace MediaBrowser.Api.Library Limit = 0, Recursive = true, IsVirtualItem = false, - SourceTypes = new[] { SourceType.Library }, IsFavorite = request.IsFavorite, DtoOptions = new DtoOptions(false) { @@ -831,6 +831,11 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); + if (item == null) + { + throw new ResourceNotFoundException("Item not found."); + } + while (item.ThemeSongIds.Count == 0 && request.InheritFromParent && item.GetParent() != null) { item = item.GetParent(); @@ -875,6 +880,11 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); + if (item == null) + { + throw new ResourceNotFoundException("Item not found."); + } + while (item.ThemeVideoIds.Count == 0 && request.InheritFromParent && item.GetParent() != null) { item = item.GetParent(); |
