From 89bcc242cf7c5a65f3b0addd5347c7eddecbdae1 Mon Sep 17 00:00:00 2001 From: Abelfreyja <96177659+Abelfreyja@users.noreply.github.com> Date: Wed, 14 Jan 2026 16:45:26 +0900 Subject: [PATCH] expand dto with urls of shards that have or don't have the requested file --- LightlessSyncAPI/Dto/Files/DownloadFileDto.cs | 14 ++++++++------ LightlessSyncAPI/Routes/LightlessFiles.cs | 8 +++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/LightlessSyncAPI/Dto/Files/DownloadFileDto.cs b/LightlessSyncAPI/Dto/Files/DownloadFileDto.cs index 72828d7..78b3dff 100644 --- a/LightlessSyncAPI/Dto/Files/DownloadFileDto.cs +++ b/LightlessSyncAPI/Dto/Files/DownloadFileDto.cs @@ -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 HasFileDirectUrls { get; set; } = new(); + public List 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; } \ No newline at end of file diff --git a/LightlessSyncAPI/Routes/LightlessFiles.cs b/LightlessSyncAPI/Routes/LightlessFiles.cs index fa932e4..f8822bb 100644 --- a/LightlessSyncAPI/Routes/LightlessFiles.cs +++ b/LightlessSyncAPI/Routes/LightlessFiles.cs @@ -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); } \ No newline at end of file