mirror of
https://github.com/Jackett/Jackett
synced 2024-12-26 09:48:37 +00:00
core: Don't perform migrations in cases where the home folder is the same as the jackett install path (#11465) resolves #11313
Additionally, add a guard to not remove config directories unless the migrated directory and initial directory are different paths
This commit is contained in:
parent
238e46b4a1
commit
88ce1d96ab
1 changed files with 11 additions and 2 deletions
|
@ -89,7 +89,12 @@ namespace Jackett.Common.Services
|
|||
// Perform a migration in case of https://github.com/Jackett/Jackett/pull/11173#issuecomment-787520128
|
||||
if (Environment.OSVersion.Platform == PlatformID.Unix)
|
||||
{
|
||||
PerformMigration("Jackett");
|
||||
// In cases where the app data folder is the same as "$(cwd)/Jackett" we don't need to perform a migration
|
||||
var fullConfigPath = Path.GetFullPath("Jackett");
|
||||
if (GetAppDataFolder() != fullConfigPath)
|
||||
{
|
||||
PerformMigration(fullConfigPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +133,11 @@ namespace Jackett.Common.Services
|
|||
}
|
||||
}
|
||||
}
|
||||
Directory.Delete(oldDirectory, true);
|
||||
|
||||
// Don't remove configs that have been migrated to the same folder
|
||||
if (GetAppDataFolder() != oldDirectory) {
|
||||
Directory.Delete(oldDirectory, true);
|
||||
}
|
||||
}
|
||||
|
||||
public T GetConfig<T>()
|
||||
|
|
Loading…
Reference in a new issue