From 147f99ecd6fe803b64f8ed49a12ad8c331957a00 Mon Sep 17 00:00:00 2001 From: patchzyy <64382339+patchzyy@users.noreply.github.com> Date: Wed, 15 Jul 2026 12:13:08 +0200 Subject: [PATCH] Fetch Retro Rewind install URL dynamically --- .../CustomDistributions/Domain/RetroRewindApi.cs | 4 ++-- .../Features/CustomDistributions/RetroRewind.cs | 10 +++++++++- WheelWizard/Services/Endpoints.cs | 1 - 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/WheelWizard/Features/CustomDistributions/Domain/RetroRewindApi.cs b/WheelWizard/Features/CustomDistributions/Domain/RetroRewindApi.cs index ccaaaf7a..3f826c84 100644 --- a/WheelWizard/Features/CustomDistributions/Domain/RetroRewindApi.cs +++ b/WheelWizard/Features/CustomDistributions/Domain/RetroRewindApi.cs @@ -4,8 +4,8 @@ namespace WheelWizard.CustomDistributions.Domain; public interface IRetroRewindApi { - [Get("/RetroRewind/zip/RetroRewind.zip")] - Task DownloadRetroRewindZip(); + [Get("/RetroRewind/RetroRewindInstall.txt")] + Task GetInstallUrl(); [Get("/RetroRewind/RetroRewindVersion.txt")] Task GetVersionFile(); diff --git a/WheelWizard/Features/CustomDistributions/RetroRewind.cs b/WheelWizard/Features/CustomDistributions/RetroRewind.cs index bab39338..f030f642 100644 --- a/WheelWizard/Features/CustomDistributions/RetroRewind.cs +++ b/WheelWizard/Features/CustomDistributions/RetroRewind.cs @@ -94,8 +94,16 @@ private async Task DownloadAndExtractRetroRewind(ProgressWindow _fileSystem.Directory.Delete(tempExtractionPath, recursive: true); _fileSystem.Directory.CreateDirectory(tempExtractionPath); + var installUrlResult = await _api.CallApiAsync(api => api.GetInstallUrl()); + if (installUrlResult.IsFailure || string.IsNullOrWhiteSpace(installUrlResult.Value)) + return Fail("Failed to get Retro Rewind download URL."); + //todo, service - var downloadedFilePath = await DownloadHelper.DownloadToLocationAsync(Endpoints.RRZipUrl, downloadedZipPath, progressWindow); + var downloadedFilePath = await DownloadHelper.DownloadToLocationAsync( + installUrlResult.Value.Trim(), + downloadedZipPath, + progressWindow + ); if (string.IsNullOrWhiteSpace(downloadedFilePath) || !_fileSystem.File.Exists(downloadedFilePath)) return progressWindow.WasCancellationRequested ? Ok() : Fail("Failed to download Retro Rewind files."); diff --git a/WheelWizard/Services/Endpoints.cs b/WheelWizard/Services/Endpoints.cs index 87202e6a..e65b431d 100644 --- a/WheelWizard/Services/Endpoints.cs +++ b/WheelWizard/Services/Endpoints.cs @@ -35,7 +35,6 @@ public static class Endpoints // Retro Rewind public const string OldRRUrl = "http://update.rwfc.net:8000/"; public const string RRUrl = "https://update.rwfc.net/"; - public const string RRZipUrl = RRUrl + "RetroRewind/zip/RetroRewind.zip"; public const string RRTestersZipUrl = RRUrl + "RetroRewind/zip/Testers.zip"; public const string RRVersionUrl = RRUrl + "RetroRewind/RetroRewindVersion.txt"; public const string RRVersionDeleteUrl = RRUrl + "RetroRewind/RetroRewindDelete.txt";