Merge pull request #4628 from MrTimscampi/no-next-resumable

Prevent GetUpNext from returning episodes in progress
This commit is contained in:
Claus Vium 2020-12-01 23:01:01 +01:00 committed by GitHub
commit 81823f9a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,7 +192,7 @@ namespace Emby.Server.Implementations.TV
Func<Episode> getEpisode = () => Func<Episode> getEpisode = () =>
{ {
return _libraryManager.GetItemList(new InternalItemsQuery(user) var nextEpisode = _libraryManager.GetItemList(new InternalItemsQuery(user)
{ {
AncestorWithPresentationUniqueKey = null, AncestorWithPresentationUniqueKey = null,
SeriesPresentationUniqueKey = seriesKey, SeriesPresentationUniqueKey = seriesKey,
@ -205,6 +205,18 @@ namespace Emby.Server.Implementations.TV
MinSortName = lastWatchedEpisode?.SortName, MinSortName = lastWatchedEpisode?.SortName,
DtoOptions = dtoOptions DtoOptions = dtoOptions
}).Cast<Episode>().FirstOrDefault(); }).Cast<Episode>().FirstOrDefault();
if (nextEpisode != null)
{
var userData = _userDataManager.GetUserData(user, nextEpisode);
if (userData.PlaybackPositionTicks > 0)
{
return null;
}
}
return nextEpisode;
}; };
if (lastWatchedEpisode != null) if (lastWatchedEpisode != null)