mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 04:13:40 +01:00
feat: note if a plugin is no longer being serviced
This commit is contained in:
parent
21b8adff4d
commit
e3cbc4dc8c
2 changed files with 51 additions and 2 deletions
|
|
@ -220,8 +220,13 @@ internal class LocalPlugin : IDisposable
|
|||
/// </summary>
|
||||
public bool IsOrphaned => !this.IsDev &&
|
||||
!this.Manifest.InstalledFromUrl.IsNullOrEmpty() && // TODO(api8): Remove this, all plugins will have a proper flag
|
||||
Service<PluginManager>.Get().Repos.All(x => x.PluginMasterUrl != this.Manifest.InstalledFromUrl) &&
|
||||
this.Manifest.InstalledFromUrl != LocalPluginManifest.FlagMainRepo;
|
||||
this.GetSourceRepository() == null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not this plugin is serviced(repo still exists, but plugin no longer does).
|
||||
/// </summary>
|
||||
public bool IsDecommissioned => !this.IsDev &&
|
||||
this.GetSourceRepository()?.PluginMaster?.FirstOrDefault(x => x.InternalName == this.Manifest.InternalName) == null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this plugin has been banned.
|
||||
|
|
@ -638,6 +643,25 @@ internal class LocalPlugin : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the repository this plugin was installed from.
|
||||
/// </summary>
|
||||
/// <returns>The plugin repository this plugin was installed from, or null if it is no longer there or if the plugin is a dev plugin.</returns>
|
||||
public PluginRepository? GetSourceRepository()
|
||||
{
|
||||
if (this.IsDev)
|
||||
return null;
|
||||
|
||||
var repos = Service<PluginManager>.Get().Repos;
|
||||
return repos.FirstOrDefault(x =>
|
||||
{
|
||||
if (!x.IsThirdParty && !this.Manifest.IsThirdParty)
|
||||
return true;
|
||||
|
||||
return x.PluginMasterUrl == this.Manifest.InstalledFromUrl;
|
||||
});
|
||||
}
|
||||
|
||||
private static void SetupLoaderConfig(LoaderConfig config)
|
||||
{
|
||||
config.IsUnloadable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue