mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
fix: label plugins that aren't actively being tested "available" in the installer
This commit is contained in:
parent
53211c0a7b
commit
46cb6a3b74
2 changed files with 37 additions and 12 deletions
|
|
@ -205,6 +205,25 @@ Thanks and have fun!";
|
|||
return !manifest.IsHide;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if a manifest even has an available testing version.
|
||||
/// </summary>
|
||||
/// <param name="manifest">The manifest to test.</param>
|
||||
/// <returns>Whether or not a testing version is available.</returns>
|
||||
public static bool HasTestingVersion(PluginManifest manifest)
|
||||
{
|
||||
var av = manifest.AssemblyVersion;
|
||||
var tv = manifest.TestingAssemblyVersion;
|
||||
var hasTv = tv != null;
|
||||
|
||||
if (hasTv)
|
||||
{
|
||||
return tv > av;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print to chat any plugin updates and whether they were successful.
|
||||
/// </summary>
|
||||
|
|
@ -249,6 +268,16 @@ Thanks and have fun!";
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For a given manifest, determine if the user opted into testing this plugin.
|
||||
/// </summary>
|
||||
/// <param name="manifest">Manifest to check.</param>
|
||||
/// <returns>A value indicating whether testing should be used.</returns>
|
||||
public bool HasTestingOptIn(PluginManifest manifest)
|
||||
{
|
||||
return this.configuration.PluginTestingOptIns!.Any(x => x.InternalName == manifest.InternalName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For a given manifest, determine if the testing version should be used over the normal version.
|
||||
/// The higher of the two versions is calculated after checking other settings.
|
||||
|
|
@ -260,22 +289,13 @@ Thanks and have fun!";
|
|||
if (!this.configuration.DoPluginTest)
|
||||
return false;
|
||||
|
||||
if (this.configuration.PluginTestingOptIns!.All(x => x.InternalName != manifest.InternalName))
|
||||
if (!this.HasTestingOptIn(manifest))
|
||||
return false;
|
||||
|
||||
if (manifest.IsTestingExclusive)
|
||||
return true;
|
||||
|
||||
var av = manifest.AssemblyVersion;
|
||||
var tv = manifest.TestingAssemblyVersion;
|
||||
var hasTv = tv != null;
|
||||
|
||||
if (hasTv)
|
||||
{
|
||||
return tv > av;
|
||||
}
|
||||
|
||||
return false;
|
||||
return HasTestingVersion(manifest);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue