updated playstate methods

pull/702/head
Luke Pulverenti 10 years ago
parent ee632803b3
commit b52bc327f2

@ -64,6 +64,6 @@ namespace MediaBrowser.Controller.Library
/// <summary>
/// Updates playstate for an item and returns true or false indicating if it was played to completion
/// </summary>
bool UpdatePlayState(BaseItem item, UserItemData data, long positionTicks);
bool UpdatePlayState(BaseItem item, UserItemData data, long? positionTicks);
}
}

@ -208,10 +208,11 @@ namespace MediaBrowser.Server.Implementations.Library
};
}
public bool UpdatePlayState(BaseItem item, UserItemData data, long positionTicks)
public bool UpdatePlayState(BaseItem item, UserItemData data, long? reportedPositionTicks)
{
var playedToCompletion = false;
var positionTicks = reportedPositionTicks ?? item.RunTimeTicks ?? 0;
var hasRuntime = item.RunTimeTicks.HasValue && item.RunTimeTicks > 0;
// If a position has been reported, and if we know the duration

@ -683,7 +683,7 @@ namespace MediaBrowser.Server.Implementations.Sync
var userData = _userDataManager.GetUserData(new Guid(action.UserId), item.GetUserDataKey());
userData.LastPlayedDate = action.Date;
_userDataManager.UpdatePlayState(item, userData, action.PositionTicks ?? item.RunTimeTicks ?? 0);
_userDataManager.UpdatePlayState(item, userData, action.PositionTicks);
return _userDataManager.SaveUserData(new Guid(action.UserId), item, userData, UserDataSaveReason.Import, CancellationToken.None);
}

Loading…
Cancel
Save