|
|
|
@ -6,6 +6,7 @@ using MediaBrowser.Controller.Entities.Audio;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
|
using MediaBrowser.Controller.Persistence;
|
|
|
|
|
using MediaBrowser.Controller.Session;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using MediaBrowser.Model.Logging;
|
|
|
|
|
using MediaBrowser.Model.Session;
|
|
|
|
|
using System;
|
|
|
|
@ -252,7 +253,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
|
|
|
|
data.Played = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _userDataRepository.SaveUserData(user.Id, key, data, CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
await _userDataRepository.SaveUserData(user.Id, key, data, UserDataSaveReason.PlaybackStart, CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
// Nothing to save here
|
|
|
|
|
// Fire events to inform plugins
|
|
|
|
@ -295,7 +296,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
|
|
|
|
var data = _userDataRepository.GetUserData(user.Id, key);
|
|
|
|
|
|
|
|
|
|
UpdatePlayState(info.Item, data, info.PositionTicks.Value);
|
|
|
|
|
await _userDataRepository.SaveUserData(user.Id, key, data, CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
await _userDataRepository.SaveUserData(user.Id, key, data, UserDataSaveReason.PlaybackProgress, CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EventHelper.QueueEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs
|
|
|
|
@ -348,7 +349,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
|
|
|
|
data.PlaybackPositionTicks = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _userDataRepository.SaveUserData(user.Id, key, data, CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
await _userDataRepository.SaveUserData(user.Id, key, data, UserDataSaveReason.PlaybackFinished, CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
EventHelper.QueueEventIfNotNull(PlaybackStopped, this, new PlaybackProgressEventArgs
|
|
|
|
|
{
|
|
|
|
|