The Free Software Media System - Server Backend & API
track progress for any item that supports the feature
dkanada02928128b998
diff --git a/Emby.Server.Implementations/Library/UserDataManager.cs b/Emby.Server.Implementations/Library/UserDataManager.csindex 48d33c26c1..071681b08f 100644--- a/Emby.Server.Implementations/Library/UserDataManager.cs+++ b/Emby.Server.Implementations/Library/UserDataManager.cs@@ -226,24 +226,21 @@ namespace Emby.Server.Implementations.Library{var pctIn = decimal.Divide(positionTicks, runtimeTicks) * 100;- // Don't track in very beginningif (pctIn < _config.Configuration.MinResumePct){+ // ignore progress during the beginningpositionTicks = 0;}-- // If we're at the end, assume completedelse if (pctIn > _config.Configuration.MaxResumePct || positionTicks >= runtimeTicks){+ // mark as completed close to the endpositionTicks = 0;data.Played = playedToCompletion = true;}-else{// Enforce MinResumeDurationvar durationSeconds = TimeSpan.FromTicks(runtimeTicks).TotalSeconds;-if (durationSeconds < _config.Configuration.MinResumeDurationSeconds){positionTicks = 0;@@ -263,6 +260,7 @@ namespace Emby.Server.Implementations.LibrarypositionTicks = 0;data.Played = false;}+if (!item.SupportsPositionTicksResume){positionTicks = 0;diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex b87ca3a114..34ffceebd2 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -667,12 +667,9 @@ namespace Emby.Server.Implementations.Sessiondata.PlayCount++;data.LastPlayedDate = DateTime.UtcNow;- if (item.SupportsPlayedStatus)+ if (item.SupportsPlayedStatus && !item.SupportsPositionTicksResume){- if (!(item is Video))- {- data.Played = true;- }+ data.Played = true;}else{@@ -769,7 +766,6 @@ namespace Emby.Server.Implementations.Session{_userDataManager.SaveUserData(user, item, data, UserDataSaveReason.PlaybackProgress, CancellationToken.None);}-}private static bool UpdatePlaybackSettings(User user, PlaybackProgressInfo info, UserItemData data)