Move methods to the right class

This commit is contained in:
David
2020-07-09 17:22:30 +02:00
parent 9be20cfaa6
commit b717ecd5e0
4 changed files with 13 additions and 646 deletions

View File

@@ -53,6 +53,7 @@ namespace Jellyfin.Api.Helpers
private readonly IServerConfigurationManager _serverConfigurationManager;
private readonly ISessionManager _sessionManager;
private readonly ILoggerFactory _loggerFactory;
private readonly IFileSystem _fileSystem;
/// <summary>
/// Initializes a new instance of the <see cref="TranscodingJobHelper"/> class.
@@ -90,10 +91,12 @@ namespace Jellyfin.Api.Helpers
_authorizationContext = authorizationContext;
_isoManager = isoManager;
_loggerFactory = loggerFactory;
_encodingHelper = new EncodingHelper(mediaEncoder, fileSystem, subtitleEncoder, configuration);
DeleteEncodedMediaCache();
sessionManager!.PlaybackProgress += OnPlaybackProgress;
sessionManager!.PlaybackStart += OnPlaybackProgress;
}
/// <summary>
@@ -834,6 +837,14 @@ namespace Jellyfin.Api.Helpers
}
}
private void OnPlaybackProgress(object sender, PlaybackProgressEventArgs e)
{
if (!string.IsNullOrWhiteSpace(e.PlaySessionId))
{
PingTranscodingJob(e.PlaySessionId, e.IsPaused);
}
}
/// <summary>
/// Deletes the encoded media cache.
/// </summary>