aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/TV
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-02 16:18:27 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-02 16:18:27 -0400
commita7b0b601fa7a783e6b8dfbbc8c74485f53a58259 (patch)
tree1a95275ee58f7f1d7f315f076efc4c39220c9e94 /Emby.Server.Implementations/TV
parent154fd214b468aa9b227626248f6469d1f4347fb8 (diff)
3.2.33.1
Diffstat (limited to 'Emby.Server.Implementations/TV')
-rw-r--r--Emby.Server.Implementations/TV/TVSeriesManager.cs28
1 files changed, 21 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs
index ec2d8c4fc..d92245a67 100644
--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs
+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs
@@ -36,8 +36,6 @@ namespace Emby.Server.Implementations.TV
throw new ArgumentException("User not found");
}
- var parentIdGuid = string.IsNullOrWhiteSpace(request.ParentId) ? (Guid?)null : new Guid(request.ParentId);
-
string presentationUniqueKey = null;
int? limit = null;
if (!string.IsNullOrWhiteSpace(request.SeriesId))
@@ -56,10 +54,26 @@ namespace Emby.Server.Implementations.TV
return GetResult(GetNextUpEpisodes(request, user, new[] { presentationUniqueKey }, dtoOptions), request);
}
- var parents = user.RootFolder.GetChildren(user, true)
- .Where(i => i is Folder)
- .Where(i => !user.Configuration.LatestItemsExcludes.Contains(i.Id.ToString("N")))
- .ToList();
+ var parentIdGuid = string.IsNullOrWhiteSpace(request.ParentId) ? (Guid?)null : new Guid(request.ParentId);
+
+ List<BaseItem> parents;
+
+ if (parentIdGuid.HasValue)
+ {
+ var parent = _libraryManager.GetItemById(parentIdGuid.Value);
+ parents = new List<BaseItem>();
+ if (parent != null)
+ {
+ parents.Add(parent);
+ }
+ }
+ else
+ {
+ parents = user.RootFolder.GetChildren(user, true)
+ .Where(i => i is Folder)
+ .Where(i => !user.Configuration.LatestItemsExcludes.Contains(i.Id.ToString("N")))
+ .ToList();
+ }
return GetNextUp(request, parents, dtoOptions);
}
@@ -88,7 +102,7 @@ namespace Emby.Server.Implementations.TV
if (!string.IsNullOrWhiteSpace(presentationUniqueKey))
{
- return GetResult(GetNextUpEpisodes(request, user, new [] { presentationUniqueKey }, dtoOptions), request);
+ return GetResult(GetNextUpEpisodes(request, user, new[] { presentationUniqueKey }, dtoOptions), request);
}
if (limit.HasValue)