diff options
| author | cvium <clausvium@gmail.com> | 2021-08-17 13:38:28 +0200 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-08-17 13:38:28 +0200 |
| commit | f23ef1f1b9982f68d03e7095593ee56667769071 (patch) | |
| tree | 8816db112021e32871c9fa1a8f54c7e49d1900f9 /Jellyfin.Api/Controllers/LiveTvController.cs | |
| parent | 2e7418142aadf3af191c6b860485581ec2f38571 (diff) | |
Use ProgressiveFileStream for LiveRecordings endpoint
Diffstat (limited to 'Jellyfin.Api/Controllers/LiveTvController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/LiveTvController.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs index 24ee833ef..47ebe9f57 100644 --- a/Jellyfin.Api/Controllers/LiveTvController.cs +++ b/Jellyfin.Api/Controllers/LiveTvController.cs @@ -1172,7 +1172,7 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesVideoFile] - public async Task<ActionResult> GetLiveRecordingFile([FromRoute, Required] string recordingId) + public ActionResult GetLiveRecordingFile([FromRoute, Required] string recordingId) { var path = _liveTvManager.GetEmbyTvActiveRecordingPath(recordingId); @@ -1181,11 +1181,8 @@ namespace Jellyfin.Api.Controllers return NotFound(); } - await using var memoryStream = new MemoryStream(); - await new ProgressiveFileCopier(path, null, _transcodingJobHelper, CancellationToken.None) - .WriteToAsync(memoryStream, CancellationToken.None) - .ConfigureAwait(false); - return File(memoryStream, MimeTypes.GetMimeType(path)); + var stream = new ProgressiveFileStream(path, null, _transcodingJobHelper); + return new FileStreamResult(stream, MimeTypes.GetMimeType(path)); } /// <summary> |
