Does this work?

This commit is contained in:
defnotken
2026-01-15 13:03:49 -06:00
parent e8c56bb3bc
commit 134268c422
3 changed files with 55 additions and 2 deletions

View File

@@ -20,13 +20,14 @@ public class ShardServerFilesController : ControllerBase
[AllowAnonymous]
public async Task<IActionResult> DownloadFileDirect(string hash, [FromQuery] long expires, [FromQuery] string signature)
{
var result = await _cdnDownloadsService.GetDownloadAsync(hash, expires, signature).ConfigureAwait(false);
var result = _cdnDownloadsService.GetDownloadWithCacheCheck(hash, expires, signature);
return result.Status switch
{
CDNDownloadsService.ResultStatus.Disabled => NotFound(),
CDNDownloadsService.ResultStatus.Unauthorized => Unauthorized(),
CDNDownloadsService.ResultStatus.NotFound => NotFound(),
CDNDownloadsService.ResultStatus.Downloading => StatusCode(503),
CDNDownloadsService.ResultStatus.Success => PhysicalFile(result.File!.FullName, "application/octet-stream"),
_ => NotFound()
};