diff --git a/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs b/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs index e9444a90..cc3a26f0 100644 --- a/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs +++ b/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs @@ -34,10 +34,10 @@ namespace Wabbajack.Lib.ModListRegistry [JsonProperty("nsfw")] public bool NSFW { get; set; } - + [JsonProperty("utility_list")] public bool UtilityList { get; set; } - + [JsonProperty("image_contains_title")] public bool ImageContainsTitle { get; set; } @@ -50,13 +50,13 @@ namespace Wabbajack.Lib.ModListRegistry [JsonProperty("download_metadata")] public DownloadMetadata? DownloadMetadata { get; set; } - [JsonIgnore] + [JsonIgnore] public ModListSummary ValidationSummary { get; set; } = new ModListSummary(); [JsonName("Links")] public class LinksObject { - [JsonProperty("image")] + [JsonProperty("image")] public string ImageUri { get; set; } = string.Empty; [JsonProperty("readme")] @@ -92,7 +92,13 @@ namespace Wabbajack.Lib.ModListRegistry // ignored } - return metadata.OrderBy(m => (m.ValidationSummary?.HasFailures ?? false ? 1 : 0, m.Title)).ToList(); + var random = new Random(); + return metadata + // Sort randomly initially, just to give each list a fair shake + .Shuffle(random) + // Put broken lists at bottom + .OrderBy(m => (m.ValidationSummary?.HasFailures ?? false ? 1 : 0)) + .ToList(); } public static async Task> LoadUnlistedFromGithub() @@ -109,7 +115,7 @@ namespace Wabbajack.Lib.ModListRegistry } } - + public async ValueTask NeedsDownload(AbsolutePath modlistPath) { if (!modlistPath.Exists) return true; @@ -150,7 +156,7 @@ namespace Wabbajack.Lib.ModListRegistry public int Passed { get; set; } [JsonProperty("updating")] public int Updating { get; set; } - + [JsonProperty("mirrored")] public int Mirrored { get; set; } diff --git a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs index fd33806e..640dd4e4 100644 --- a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs +++ b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs @@ -95,7 +95,6 @@ namespace Wabbajack }) .DisposeWith(CompositeDisposable); - var random = new Random(); var sourceList = Observable.Return(Unit.Default) .ObserveOn(RxApp.TaskpoolScheduler) .SelectTask(async _ => @@ -106,8 +105,6 @@ namespace Wabbajack var list = await ModlistMetadata.LoadFromGithub(); Error = ErrorResponse.Success; return list - // Sort randomly initially, just to give each list a fair shake - .Shuffle(random) .AsObservableChangeSet(x => x.DownloadMetadata?.Hash ?? Hash.Empty); } catch (Exception ex) @@ -170,8 +167,6 @@ namespace Wabbajack return GameType == vm.Metadata.Game.GetDescription().ToString(); })) - // Put broken lists at bottom - .Sort(Comparer.Create((a, b) => a.IsBroken.CompareTo(b.IsBroken))) .Bind(ModLists) .Subscribe() .DisposeWith(CompositeDisposable);