mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-03-17 21:12:22 +01:00
Redirect to files.v0l.io
This commit is contained in:
parent
691beb9334
commit
ac3b965d5d
@ -43,6 +43,13 @@ public abstract class BaseDownloadController : Controller
|
||||
return;
|
||||
}
|
||||
|
||||
if (voidFile.Uploader?.IsNostr ?? false)
|
||||
{
|
||||
Response.StatusCode = (int)HttpStatusCode.Redirect;
|
||||
Response.Headers.Location = $"https://files.v0l.io/{voidFile.Metadata.Digest}";
|
||||
return;
|
||||
}
|
||||
|
||||
var egressReq = new EgressRequest(gid, GetRanges(Request, (long)voidFile!.Metadata!.Size));
|
||||
if (egressReq.Ranges.Count() > 1)
|
||||
{
|
||||
|
@ -48,4 +48,6 @@ public class ApiUser
|
||||
/// When the account was created
|
||||
/// </summary>
|
||||
public DateTime Created { get; init; }
|
||||
|
||||
public bool IsNostr { get; init; }
|
||||
}
|
||||
|
@ -375,7 +375,8 @@ public static class Extensions
|
||||
NeedsVerification = isSelf ? !u.Flags.HasFlag(UserFlags.EmailVerified) : null,
|
||||
PublicProfile = u.Flags.HasFlag(UserFlags.PublicProfile),
|
||||
PublicUploads = u.Flags.HasFlag(UserFlags.PublicUploads),
|
||||
Roles = u.Roles.Select(a => a.Role).ToList()
|
||||
Roles = u.Roles.Select(a => a.Role).ToList(),
|
||||
IsNostr = u.AuthType is UserAuthType.Nostr
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user