mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
Rework plugin deletion + misc (#927)
* fix: stuck overlay on errors * feat: delete old plugin versions * feat: ignore error tag when outdated, banned, or orphaned * feat: rework plugin deletion
This commit is contained in:
parent
62831f8d1e
commit
1574ef7c33
4 changed files with 97 additions and 19 deletions
|
|
@ -848,10 +848,17 @@ internal partial class PluginManager : IDisposable, IServiceType
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach (var versionDir in versionDirs)
|
||||
for (var i = 0; i < versionDirs.Length; i++)
|
||||
{
|
||||
var versionDir = versionDirs[i];
|
||||
try
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
Log.Information($"Old version: cleaning up {versionDir.FullName}");
|
||||
versionDir.Delete(true);
|
||||
continue;
|
||||
}
|
||||
var dllFile = new FileInfo(Path.Combine(versionDir.FullName, $"{pluginDir.Name}.dll"));
|
||||
if (!dllFile.Exists)
|
||||
{
|
||||
|
|
@ -865,6 +872,21 @@ internal partial class PluginManager : IDisposable, IServiceType
|
|||
{
|
||||
Log.Information($"Missing manifest: cleaning up {versionDir.FullName}");
|
||||
versionDir.Delete(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (manifestFile.Length == 0)
|
||||
{
|
||||
Log.Information($"Manifest empty: cleaning up {versionDir.FullName}");
|
||||
versionDir.Delete(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
var manifest = LocalPluginManifest.Load(manifestFile);
|
||||
if (manifest.ScheduledForDeletion)
|
||||
{
|
||||
Log.Information($"Scheduled deletion: cleaning up {versionDir.FullName}");
|
||||
versionDir.Delete(true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -902,6 +924,9 @@ internal partial class PluginManager : IDisposable, IServiceType
|
|||
if (plugin.InstalledPlugin.Manifest.Disabled && ignoreDisabled)
|
||||
continue;
|
||||
|
||||
if (plugin.InstalledPlugin.Manifest.ScheduledForDeletion)
|
||||
continue;
|
||||
|
||||
var result = await this.UpdateSinglePluginAsync(plugin, false, dryRun);
|
||||
if (result != null)
|
||||
updatedList.Add(result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue