diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-02-26 09:50:58 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-02-26 09:50:58 -0500 |
| commit | 5caa63367af888234ab14bdfb74872d911eebec2 (patch) | |
| tree | 4798ce0aa8077327a76be7784715d361ba5f73fc | |
| parent | 612986e4ae46d7c98001e7b8b7fd9b770c6646e6 (diff) | |
support autoplay with dlna
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 1074796c0..08953b0be 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -983,6 +983,26 @@ namespace MediaBrowser.Server.Implementations.Session } } + if (user != null && command.ItemIds.Length == 1 && user.Configuration.EnableNextEpisodeAutoPlay) + { + var episode = _libraryManager.GetItemById(command.ItemIds[0]) as Episode; + if (episode != null) + { + var series = episode.Series; + if (series != null) + { + var episodes = series.GetEpisodes(user, false, false) + .SkipWhile(i => i.Id != episode.Id) + .ToList(); + + if (episodes.Count > 0) + { + command.ItemIds = episodes.Select(i => i.Id.ToString("N")).ToArray(); + } + } + } + } + var controllingSession = GetSession(controllingSessionId); AssertCanControl(session, controllingSession); if (controllingSession.UserId.HasValue) |
