From 7447a54c13631b5ecf7b4e10cef2cbf52a357042 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Sun, 1 Feb 2026 00:47:11 +1100 Subject: tmp --- Controllers/MediaController.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Controllers') diff --git a/Controllers/MediaController.cs b/Controllers/MediaController.cs index fa6e7ab..3368f45 100644 --- a/Controllers/MediaController.cs +++ b/Controllers/MediaController.cs @@ -79,6 +79,17 @@ public class MediaController : Controller { .ElementAtOrDefault(0)? .TryParseDateTimeUtc(); + // Parse original path from headers + string? path = + formFile.Headers["X-HyperBooru-Path"] + .ElementAtOrDefault(0); + + object? pathType = null; + string? pathTypeString = + formFile.Headers["X-HyperBooru-PathType"] + .ElementAtOrDefault(0); + Enum.TryParse(typeof(PathType), pathTypeString, true, out pathType); + media = mediaService.Create( formFile.OpenReadStream(), formFile.FileName, @@ -86,7 +97,9 @@ public class MediaController : Controller { .ElementAtOrDefault(0), lastAccessTime, lastWriteTime, - createTime); + createTime, + path, + (PathType?) pathType); } catch(MediaCreateException e) { return BadRequest(e.Message); } -- cgit v1.3