aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-18 08:00:57 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-18 08:00:57 -0400
commitaec36e80966a04bec4d5e9ae67b7d99818901cb2 (patch)
tree7b6e959a58777f6ac971d0f7ae45020197ed4e8b /MediaBrowser.Server.Implementations/Session/SessionManager.cs
parent69f4ef6c774e31555204430364921aa74337255a (diff)
catch when negative playback position is reported
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index fde1eba9d..697e13517 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -255,14 +255,13 @@ namespace MediaBrowser.Server.Implementations.Session
/// <summary>
/// Used to report playback progress for an item
/// </summary>
- /// <param name="user">The user.</param>
/// <param name="item">The item.</param>
/// <param name="positionTicks">The position ticks.</param>
/// <param name="isPaused">if set to <c>true</c> [is paused].</param>
/// <param name="sessionId">The session id.</param>
/// <returns>Task.</returns>
- /// <exception cref="System.ArgumentNullException">
- /// </exception>
+ /// <exception cref="System.ArgumentNullException"></exception>
+ /// <exception cref="System.ArgumentOutOfRangeException">positionTicks</exception>
public async Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, Guid sessionId)
{
if (item == null)
@@ -270,6 +269,11 @@ namespace MediaBrowser.Server.Implementations.Session
throw new ArgumentNullException();
}
+ if (positionTicks.HasValue && positionTicks.Value < 0)
+ {
+ throw new ArgumentOutOfRangeException("positionTicks");
+ }
+
var session = Sessions.First(i => i.Id.Equals(sessionId));
UpdateNowPlayingItem(session, item, isPaused, positionTicks);
@@ -310,6 +314,11 @@ namespace MediaBrowser.Server.Implementations.Session
throw new ArgumentNullException();
}
+ if (positionTicks.HasValue && positionTicks.Value < 0)
+ {
+ throw new ArgumentOutOfRangeException("positionTicks");
+ }
+
var session = Sessions.First(i => i.Id.Equals(sessionId));
RemoveNowPlayingItem(session, item);