mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
update playback progress reporting
This commit is contained in:
@@ -21,7 +21,6 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
_sessionManager = sessionManager;
|
||||
_logger = logger;
|
||||
QueueableMediaTypes = new List<string>();
|
||||
|
||||
AdditionalUsers = new List<SessionUserInfo>();
|
||||
PlayState = new PlayerStateInfo();
|
||||
@@ -39,12 +38,6 @@ namespace MediaBrowser.Controller.Session
|
||||
/// <value>The remote end point.</value>
|
||||
public string RemoteEndPoint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the queueable media types.
|
||||
/// </summary>
|
||||
/// <value>The queueable media types.</value>
|
||||
public List<string> QueueableMediaTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playable media types.
|
||||
/// </summary>
|
||||
@@ -214,12 +207,14 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
_lastProgressInfo = progressInfo;
|
||||
|
||||
if (_progressTimer != null)
|
||||
if (_progressTimer == null)
|
||||
{
|
||||
return;
|
||||
_progressTimer = timerFactory.Create(OnProgressTimerCallback, null, 1000, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
_progressTimer.Change(1000, 1000);
|
||||
}
|
||||
|
||||
_progressTimer = timerFactory.Create(OnProgressTimerCallback, null, 1000, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,10 +232,11 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var positionTicks = progressInfo.PositionTicks ?? 0;
|
||||
if (positionTicks <= 0)
|
||||
if (positionTicks < 0)
|
||||
{
|
||||
return;
|
||||
positionTicks = 0;
|
||||
}
|
||||
|
||||
var newPositionTicks = positionTicks + ProgressIncrement;
|
||||
|
||||
Reference in New Issue
Block a user