diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-10-26 18:42:17 -0600 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2021-10-26 18:42:17 -0600 |
| commit | a6357f89abb40deaa84ed0ea52010c098e769e62 (patch) | |
| tree | e2697de1b14d3901a0e3d6263c2533f244345c09 /Jellyfin.Api/Controllers/ClientLogController.cs | |
| parent | f78f1e834ce1907157d4d43cf8564cf40d05fb9f (diff) | |
Add ability to upload entire file
Diffstat (limited to 'Jellyfin.Api/Controllers/ClientLogController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ClientLogController.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/ClientLogController.cs b/Jellyfin.Api/Controllers/ClientLogController.cs index b894deb84..9fe3bf731 100644 --- a/Jellyfin.Api/Controllers/ClientLogController.cs +++ b/Jellyfin.Api/Controllers/ClientLogController.cs @@ -1,4 +1,5 @@ -using Jellyfin.Api.Constants; +using System.Threading.Tasks; +using Jellyfin.Api.Constants; using Jellyfin.Api.Models.ClientLogDtos; using MediaBrowser.Controller.ClientEvent; using MediaBrowser.Model.ClientLog; @@ -57,6 +58,20 @@ namespace Jellyfin.Api.Controllers return NoContent(); } + /// <summary> + /// Upload a log file. + /// </summary> + /// <param name="file">The file.</param> + /// <returns>Submission status.</returns> + [HttpPost("File")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public async Task<ActionResult> LogFile(IFormFile file) + { + await _clientEventLogger.WriteFileAsync(file.FileName, file.OpenReadStream()) + .ConfigureAwait(false); + return NoContent(); + } + private void Log(ClientLogEventDto dto) { _clientEventLogger.Log(new ClientLogEvent( @@ -69,4 +84,4 @@ namespace Jellyfin.Api.Controllers dto.Message)); } } -}
\ No newline at end of file +} |
