expand dto with urls of shards that have or don't have the requested file
This commit is contained in:
@@ -5,12 +5,14 @@ namespace LightlessSync.API.Dto.Files;
|
||||
[MessagePackObject(keyAsPropertyName: true)]
|
||||
public record DownloadFileDto : ITransferFileDto
|
||||
{
|
||||
public bool FileExists { get; set; } = true;
|
||||
public string Hash { get; set; } = string.Empty;
|
||||
public string Url { get; set; } = string.Empty;
|
||||
public string CDNDownloadUrl { get; set; } = string.Empty;
|
||||
public long Size { get; set; } = 0;
|
||||
public bool IsForbidden { get; set; } = false;
|
||||
public bool FileExists { get; set; } = true;
|
||||
public string Hash { get; set; } = string.Empty;
|
||||
public string Url { get; set; } = string.Empty;
|
||||
public string CDNDownloadUrl { get; set; } = string.Empty;
|
||||
public List<string> HasFileDirectUrls { get; set; } = new();
|
||||
public List<string> PullThroughDirectUrls { get; set; } = new();
|
||||
public long Size { get; set; } = 0;
|
||||
public bool IsForbidden { get; set; } = false;
|
||||
public string ForbiddenBy { get; set; } = string.Empty;
|
||||
public long RawSize { get; set; } = 0;
|
||||
}
|
||||
@@ -23,8 +23,9 @@ public class LightlessFiles
|
||||
public const string Distribution = "/dist";
|
||||
public const string Distribution_Get = "get";
|
||||
|
||||
public const string Main = "/main";
|
||||
public const string Main_SendReady = "sendReady";
|
||||
public const string Main = "/main";
|
||||
public const string Main_SendReady = "sendReady";
|
||||
public const string Main_ShardFiles = "shardFiles";
|
||||
|
||||
public const string Speedtest = "/speedtest";
|
||||
public const string Speedtest_Run = "run";
|
||||
@@ -45,5 +46,6 @@ public class LightlessFiles
|
||||
public static Uri ServerFilesDirectDownloadFullPath(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_DirectDownload + "/" + hash);
|
||||
public static Uri DistributionGetFullPath(Uri baseUri, string hash) => new(baseUri, Distribution + "/" + Distribution_Get + "?file=" + hash);
|
||||
public static Uri SpeedtestRunFullPath(Uri baseUri) => new(baseUri, Speedtest + "/" + Speedtest_Run);
|
||||
public static Uri MainSendReadyFullPath(Uri baseUri, string uid, Guid request) => new(baseUri, Main + "/" + Main_SendReady + "/" + "?uid=" + uid + "&requestId=" + request.ToString());
|
||||
public static Uri MainSendReadyFullPath(Uri baseUri, string uid, Guid request) => new(baseUri, Main + "/" + Main_SendReady + "/" + "?uid=" + uid + "&requestId=" + request.ToString());
|
||||
public static Uri MainShardFilesFullPath(Uri baseUri) => new(baseUri, Main + "/" + Main_ShardFiles);
|
||||
}
|
||||
Reference in New Issue
Block a user