From 1c779639d8f656d4c4fb35b8425937ad40d4d08b Mon Sep 17 00:00:00 2001 From: FlexBy420 <68403300+FlexBy420@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:11:53 +0100 Subject: [PATCH 1/2] fix ird download link IRDs that have spaces and other characters like () didnt create a proper link --- Clients/IrdLibraryClient/IrdClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Clients/IrdLibraryClient/IrdClient.cs b/Clients/IrdLibraryClient/IrdClient.cs index 9f632b18..32ac2cf1 100644 --- a/Clients/IrdLibraryClient/IrdClient.cs +++ b/Clients/IrdLibraryClient/IrdClient.cs @@ -125,6 +125,6 @@ public async Task> DownloadAsync(string productCode, string localCache } } - public static Uri GetDownloadLink(string relativeLink) => new(BaseDownloadUri, relativeLink); + public static string GetDownloadLink(string relativeLink) => Uri.EscapeUriString(new Uri(BaseDownloadUri, relativeLink).ToString()); } } From de8fc19240500a3d1eb7a3bbad4fb0de8609272c Mon Sep 17 00:00:00 2001 From: FlexBy420 <68403300+FlexBy420@users.noreply.github.com> Date: Sat, 14 Dec 2024 18:54:43 +0100 Subject: [PATCH 2/2] fix warning --- Clients/IrdLibraryClient/IrdClient.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Clients/IrdLibraryClient/IrdClient.cs b/Clients/IrdLibraryClient/IrdClient.cs index 32ac2cf1..fa67770b 100644 --- a/Clients/IrdLibraryClient/IrdClient.cs +++ b/Clients/IrdLibraryClient/IrdClient.cs @@ -125,6 +125,11 @@ public async Task> DownloadAsync(string productCode, string localCache } } - public static string GetDownloadLink(string relativeLink) => Uri.EscapeUriString(new Uri(BaseDownloadUri, relativeLink).ToString()); + public static string GetDownloadLink(string relativeLink) + { + var encodedLink = Uri.EscapeDataString(relativeLink); + var fullUri = new Uri(BaseDownloadUri, encodedLink); + return fullUri.AbsoluteUri; + } } }