Skip to content
Open
3 changes: 3 additions & 0 deletions StabilityMatrix.Avalonia/DesignData/DesignData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ public static void Initialize()
public static HuggingFacePageViewModel HuggingFacePageViewModel =>
Services.GetRequiredService<HuggingFacePageViewModel>();

public static DirectUrlImportViewModel DirectUrlImportViewModel =>
Services.GetRequiredService<DirectUrlImportViewModel>();

public static NewOneClickInstallViewModel NewOneClickInstallViewModel =>
Services.GetRequiredService<NewOneClickInstallViewModel>();

Expand Down
17 changes: 13 additions & 4 deletions StabilityMatrix.Avalonia/Services/ModelImportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,19 @@ await notificationService.TryAsync(
cleanupFilePaths.Add(previewImageDownloadPath);
}

// Create tracked download
// todo: support multiple uris
var modelUri = modelUris.First();
var download = trackedDownloadService.NewDownload(modelUri, downloadPath);
// Create tracked download with first URL, storing others as fallbacks
// If download fails, the TrackedDownloadService will attempt to use fallback URLs
var uriList = modelUris.ToList();
var primaryUri = uriList.First();
var fallbackUris = uriList.Skip(1).ToList();

var download = trackedDownloadService.NewDownload(primaryUri, downloadPath);

// Store fallback URLs for retry attempts
if (fallbackUris.Count > 0)
{
download.FallbackUris = fallbackUris;
}

// Add hash info
// download.ExpectedHashSha256 = modelFile.Hashes.SHA256;
Expand Down
Loading
Loading