Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace WheelWizard.CustomDistributions.Domain;

public interface IRetroRewindApi
{
[Get("/RetroRewind/zip/RetroRewind.zip")]
Task<HttpContent> DownloadRetroRewindZip();
[Get("/RetroRewind/RetroRewindInstall.txt")]
Task<string> GetInstallUrl();

[Get("/RetroRewind/RetroRewindVersion.txt")]
Task<string> GetVersionFile();
Expand Down
10 changes: 9 additions & 1 deletion WheelWizard/Features/CustomDistributions/RetroRewind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ private async Task<OperationResult> 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.");

Expand Down
1 change: 0 additions & 1 deletion WheelWizard/Services/Endpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading