aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-17 15:01:16 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-17 15:01:16 -0400
commit561028c90734b911ebb5eec26aa071fb6851a2a6 (patch)
tree48a40e09ec701926d982f2979adefe94ba763448 /Emby.Server.Implementations/Session/SessionManager.cs
parent0b5019ed1b8c7624eae27aebe715132e07f8a417 (diff)
update automated checkins
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs38
1 files changed, 14 insertions, 24 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index ed0a47121..63556c1ce 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -310,10 +310,7 @@ namespace Emby.Server.Implementations.Session
/// <summary>
/// Updates the now playing item id.
/// </summary>
- /// <param name="session">The session.</param>
- /// <param name="info">The information.</param>
- /// <param name="libraryItem">The library item.</param>
- private async Task UpdateNowPlayingItem(SessionInfo session, PlaybackProgressInfo info, BaseItem libraryItem)
+ private async Task UpdateNowPlayingItem(SessionInfo session, PlaybackProgressInfo info, BaseItem libraryItem, bool updateLastCheckInTime)
{
if (string.IsNullOrWhiteSpace(info.MediaSourceId))
{
@@ -352,7 +349,11 @@ namespace Emby.Server.Implementations.Session
session.NowPlayingItem = info.Item;
session.LastActivityDate = DateTime.UtcNow;
- session.LastPlaybackCheckIn = DateTime.UtcNow;
+
+ if (updateLastCheckInTime)
+ {
+ session.LastPlaybackCheckIn = DateTime.UtcNow;
+ }
session.PlayState.IsPaused = info.IsPaused;
session.PlayState.PositionTicks = info.PositionTicks;
@@ -604,7 +605,7 @@ namespace Emby.Server.Implementations.Session
? null
: GetNowPlayingItem(session, info.ItemId);
- await UpdateNowPlayingItem(session, info, libraryItem).ConfigureAwait(false);
+ await UpdateNowPlayingItem(session, info, libraryItem, true).ConfigureAwait(false);
if (!string.IsNullOrEmpty(session.DeviceId) && info.PlayMethod != PlayMethod.Transcode)
{
@@ -671,14 +672,15 @@ namespace Emby.Server.Implementations.Session
await _userDataManager.SaveUserData(userId, item, data, UserDataSaveReason.PlaybackStart, CancellationToken.None).ConfigureAwait(false);
}
+ public Task OnPlaybackProgress(PlaybackProgressInfo info)
+ {
+ return OnPlaybackProgress(info, false);
+ }
+
/// <summary>
/// Used to report playback progress for an item
/// </summary>
- /// <param name="info">The info.</param>
- /// <returns>Task.</returns>
- /// <exception cref="System.ArgumentNullException"></exception>
- /// <exception cref="System.ArgumentOutOfRangeException">positionTicks</exception>
- public async Task OnPlaybackProgress(PlaybackProgressInfo info)
+ public async Task OnPlaybackProgress(PlaybackProgressInfo info, bool isAutomated)
{
if (info == null)
{
@@ -691,7 +693,7 @@ namespace Emby.Server.Implementations.Session
? null
: GetNowPlayingItem(session, info.ItemId);
- await UpdateNowPlayingItem(session, info, libraryItem).ConfigureAwait(false);
+ await UpdateNowPlayingItem(session, info, libraryItem, !isAutomated).ConfigureAwait(false);
var users = GetUsers(session);
@@ -703,18 +705,6 @@ namespace Emby.Server.Implementations.Session
}
}
- if (!string.IsNullOrWhiteSpace(info.LiveStreamId))
- {
- try
- {
- await _mediaSourceManager.PingLiveStream(info.LiveStreamId, CancellationToken.None).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error closing live stream", ex);
- }
- }
-
EventHelper.FireEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs
{
Item = libraryItem,