diff --git a/DeliCounter/Backend/ModRepository.cs b/DeliCounter/Backend/ModRepository.cs index 7f1cf0e..ac5cbc0 100644 --- a/DeliCounter/Backend/ModRepository.cs +++ b/DeliCounter/Backend/ModRepository.cs @@ -203,6 +203,7 @@ private Exception ScanMods() if (version.IconUrl == "") throw new JsonException($"[{version}] Icon url cannot be empty, must be null."); if ((App.Current.Settings is not null && !App.Current.Settings.ShowModBetas) && !string.IsNullOrEmpty(version.VersionNumber.PreRelease)) continue; + if (!App.Current.Settings.ShowModBetas && version.IsBeta) continue; mod.Versions.Add(version.VersionNumber, version); } diff --git a/DeliCounter/Backend/Models/Mod.cs b/DeliCounter/Backend/Models/Mod.cs index 25f727a..1c1bfdc 100644 --- a/DeliCounter/Backend/Models/Mod.cs +++ b/DeliCounter/Backend/Models/Mod.cs @@ -158,6 +158,11 @@ public class ModVersion /// public string[] IncompatibleTags { get; set; } + /// + /// True if the mod should only be shown to people who have the beta option enbled + /// + public bool IsBeta { get; set; } + [JsonIgnore] public IEnumerable IncompatibleInstalledMods => IncompatibleTags == null ? Array.Empty() @@ -168,11 +173,6 @@ public class ModVersion x.Installed.Tags != null && IncompatibleTags.Any(tag => x.Installed.Tags.Contains(tag)))); - /// - /// Checks if the version number has a pre release tag - /// - public bool IsBeta => !string.IsNullOrEmpty(VersionNumber.PreRelease); - public bool MatchesQuery(string query) {