Added AudioBookFile chapters update played status call to OnPlaybackStopped and fixed logic error

pull/11517/head
Samson50 3 weeks ago
parent b070d7d402
commit de5cc7b72f

@ -295,7 +295,7 @@ namespace Emby.Server.Implementations.Library
var pctIn = decimal.Divide(positionTicks, runtimeTicks) * 100;
// NOTE: The close we can get pctIn comparison value to 100 without bugs, the better
if (pctIn < 98 || positionTicks >= runtimeTicks)
if (pctIn > 98 || positionTicks >= runtimeTicks)
{
// mark as completed close to the end
positionTicks = 0;

@ -1045,6 +1045,12 @@ namespace Emby.Server.Implementations.Session
_userDataManager.SaveUserData(user, item, data, UserDataSaveReason.PlaybackFinished, CancellationToken.None);
// Update played status for other AudioBook chapters
if (item is AudioBookFile audioBookFile)
{
audioBookFile.SetFilesPlayed(user, _userDataManager);
}
return playedToCompletion;
}

@ -177,7 +177,7 @@ namespace MediaBrowser.Controller.Entities.AudioBooks
bool afterCurrent = false;
foreach (var chapter in chapters)
{
if (chapter == this)
if (chapter.Name == Name)
{
afterCurrent = true;
continue;

Loading…
Cancel
Save