mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Merge branch 'development'
This commit is contained in:
commit
a793a08213
58 files changed
+1476
-336
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user