Use ProgressiveFileStream for LiveRecordings endpoint

This commit is contained in:
cvium 2021-08-17 13:38:28 +02:00
parent 2e7418142a
commit f23ef1f1b9

View File

@ -1172,7 +1172,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesVideoFile] [ProducesVideoFile]
public async Task<ActionResult> GetLiveRecordingFile([FromRoute, Required] string recordingId) public ActionResult GetLiveRecordingFile([FromRoute, Required] string recordingId)
{ {
var path = _liveTvManager.GetEmbyTvActiveRecordingPath(recordingId); var path = _liveTvManager.GetEmbyTvActiveRecordingPath(recordingId);
@ -1181,11 +1181,8 @@ namespace Jellyfin.Api.Controllers
return NotFound(); return NotFound();
} }
await using var memoryStream = new MemoryStream(); var stream = new ProgressiveFileStream(path, null, _transcodingJobHelper);
await new ProgressiveFileCopier(path, null, _transcodingJobHelper, CancellationToken.None) return new FileStreamResult(stream, MimeTypes.GetMimeType(path));
.WriteToAsync(memoryStream, CancellationToken.None)
.ConfigureAwait(false);
return File(memoryStream, MimeTypes.GetMimeType(path));
} }
/// <summary> /// <summary>