Merge branch 'development'

This commit is contained in:
Robert committed 2024-07-22 11:02:05 +02:00
commit a793a08213
58 files changed
+1476 -336

No files matched your search

+15 -1
View File
@@ -116,6 +116,11 @@ public class PluginInfo : IPrerequisitesSubject
[JsonInclude]
public Version? Api { get; internal init; } = new(1, 0, 0);
/// <summary>
/// Gets the minimum version of Artemis required by this plugin
/// </summary>
public Version? MinimumVersion { get; internal init; } = new(1, 0, 0);
/// <summary>
/// Gets the plugin this info is associated with
/// </summary>
@@ -132,7 +137,7 @@ public class PluginInfo : IPrerequisitesSubject
/// Gets a boolean indicating whether this plugin is compatible with the current operating system and API version
/// </summary>
[JsonIgnore]
public bool IsCompatible => Platforms.MatchesCurrentOperatingSystem() && Api != null && Api.Major >= Constants.PluginApiVersion;
public bool IsCompatible => Platforms.MatchesCurrentOperatingSystem() && Api != null && Api.Major >= Constants.PluginApiVersion && MatchesMinimumVersion();
/// <inheritdoc />
[JsonIgnore]
@@ -156,4 +161,13 @@ public class PluginInfo : IPrerequisitesSubject
{
return $"{Name} v{Version} - {Guid}";
}
private bool MatchesMinimumVersion()
{
if (Constants.CurrentVersion == "local")
return true;
Version currentVersion = new(Constants.CurrentVersion);
return currentVersion >= MinimumVersion;
}
}