mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-19 23:35:25 +03:00
Add ability to upload entire file
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user