mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-03-17 21:12:22 +01:00
fix: nostr redirect user load
This commit is contained in:
parent
f7c799f694
commit
03d09e21d7
@ -90,13 +90,13 @@ public abstract class BaseDownloadController : Controller
|
||||
|
||||
protected async Task<VoidFileResponse?> SetupDownload(Guid id)
|
||||
{
|
||||
var meta = await _fileInfo.Get(id, false);
|
||||
var meta = await _fileInfo.Get(id, true);
|
||||
if (meta == null)
|
||||
{
|
||||
Response.StatusCode = 404;
|
||||
return default;
|
||||
}
|
||||
|
||||
|
||||
if (meta.Uploader?.IsNostr ?? false)
|
||||
{
|
||||
Response.StatusCode = (int)HttpStatusCode.Redirect;
|
||||
@ -104,6 +104,11 @@ public abstract class BaseDownloadController : Controller
|
||||
return default;
|
||||
}
|
||||
|
||||
if (meta.Uploader != default)
|
||||
{
|
||||
meta.Uploader = meta.Uploader!.PublicProfile ? meta.Uploader : null;
|
||||
}
|
||||
|
||||
return await CheckDownload(meta);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ public class VoidFileResponse
|
||||
public Guid Id { get; init; }
|
||||
public VoidFileMeta Metadata { get; init; } = null!;
|
||||
public Paywall? Payment { get; init; }
|
||||
public ApiUser? Uploader { get; init; }
|
||||
public ApiUser? Uploader { get; set; }
|
||||
public Bandwidth? Bandwidth { get; init; }
|
||||
public VirusStatus? VirusScan { get; init; }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user