diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-12-01 23:01:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-01 23:01:01 +0100 |
| commit | 81823f9a3d18a115df3182ab5f5baa2a2e198166 (patch) | |
| tree | e59eb99ebc19b9865f4cb0459204ca00e26b60a9 | |
| parent | ffd45b8df75b13f1327fa9aafed21bbb5850f5d4 (diff) | |
| parent | 673d2c0d261bffae1769c3a357cd5f01912afc80 (diff) | |
Merge pull request #4628 from MrTimscampi/no-next-resumable
Prevent GetUpNext from returning episodes in progress
| -rw-r--r-- | Emby.Server.Implementations/TV/TVSeriesManager.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs index a697c6476..3cfcecbd1 100644 --- a/Emby.Server.Implementations/TV/TVSeriesManager.cs +++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs @@ -192,7 +192,7 @@ namespace Emby.Server.Implementations.TV Func<Episode> getEpisode = () => { - return _libraryManager.GetItemList(new InternalItemsQuery(user) + var nextEpisode = _libraryManager.GetItemList(new InternalItemsQuery(user) { AncestorWithPresentationUniqueKey = null, SeriesPresentationUniqueKey = seriesKey, @@ -205,6 +205,18 @@ namespace Emby.Server.Implementations.TV MinSortName = lastWatchedEpisode?.SortName, DtoOptions = dtoOptions }).Cast<Episode>().FirstOrDefault(); + + if (nextEpisode != null) + { + var userData = _userDataManager.GetUserData(user, nextEpisode); + + if (userData.PlaybackPositionTicks > 0) + { + return null; + } + } + + return nextEpisode; }; if (lastWatchedEpisode != null) |
