aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryService.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-06-11 18:05:07 -0400
committerGitHub <noreply@github.com>2017-06-11 18:05:07 -0400
commite0c907cc6009408157d42531afab4c089c2e2871 (patch)
tree069efdd6b11b3dd81e7bc6c191497114374f0577 /MediaBrowser.Api/Library/LibraryService.cs
parent9ee58d399cde4ccec9ea10c60c1a508a353b7836 (diff)
parente9d2fb13e06a93336b6b16d03b66d3390a762c40 (diff)
Merge pull request #2702 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs12
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();