Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
Fixed mods marked as beta showing for everyone regardless of setting
Browse files Browse the repository at this point in the history
  • Loading branch information
nrgill28 committed May 7, 2021
1 parent a6165af commit 544b694
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions DeliCounter/Backend/ModRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 5 additions & 5 deletions DeliCounter/Backend/Models/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public class ModVersion
/// </summary>
public string[] IncompatibleTags { get; set; }

/// <summary>
/// True if the mod should only be shown to people who have the beta option enbled
/// </summary>
public bool IsBeta { get; set; }

[JsonIgnore]
public IEnumerable<Mod> IncompatibleInstalledMods => IncompatibleTags == null
? Array.Empty<Mod>()
Expand All @@ -168,11 +173,6 @@ public class ModVersion
x.Installed.Tags != null &&
IncompatibleTags.Any(tag => x.Installed.Tags.Contains(tag))));

/// <summary>
/// Checks if the version number has a pre release tag
/// </summary>
public bool IsBeta => !string.IsNullOrEmpty(VersionNumber.PreRelease);


public bool MatchesQuery(string query)
{
Expand Down

0 comments on commit 544b694

Please sign in to comment.