|
|
|
@ -19,7 +19,7 @@ namespace MediaBrowser.Controller.Session
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class SessionInfo.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class SessionInfo : IAsyncDisposable, IDisposable
|
|
|
|
|
public sealed class SessionInfo : IAsyncDisposable
|
|
|
|
|
{
|
|
|
|
|
// 1 second
|
|
|
|
|
private const long ProgressIncrement = 10000000;
|
|
|
|
@ -374,26 +374,6 @@ namespace MediaBrowser.Controller.Session
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
_disposed = true;
|
|
|
|
|
|
|
|
|
|
StopAutomaticProgress();
|
|
|
|
|
|
|
|
|
|
var controllers = SessionControllers.ToList();
|
|
|
|
|
SessionControllers = Array.Empty<ISessionController>();
|
|
|
|
|
|
|
|
|
|
foreach (var controller in controllers)
|
|
|
|
|
{
|
|
|
|
|
if (controller is IDisposable disposable)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogDebug("Disposing session controller synchronously {TypeName}", disposable.GetType().Name);
|
|
|
|
|
disposable.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async ValueTask DisposeAsync()
|
|
|
|
|
{
|
|
|
|
|
_disposed = true;
|
|
|
|
@ -401,6 +381,7 @@ namespace MediaBrowser.Controller.Session
|
|
|
|
|
StopAutomaticProgress();
|
|
|
|
|
|
|
|
|
|
var controllers = SessionControllers.ToList();
|
|
|
|
|
SessionControllers = Array.Empty<ISessionController>();
|
|
|
|
|
|
|
|
|
|
foreach (var controller in controllers)
|
|
|
|
|
{
|
|
|
|
@ -409,6 +390,11 @@ namespace MediaBrowser.Controller.Session
|
|
|
|
|
_logger.LogDebug("Disposing session controller asynchronously {TypeName}", disposableAsync.GetType().Name);
|
|
|
|
|
await disposableAsync.DisposeAsync().ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
else if (controller is IDisposable disposable)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogDebug("Disposing session controller synchronously {TypeName}", disposable.GetType().Name);
|
|
|
|
|
disposable.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|