mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02: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:
@@ -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>()
|
||||
|
Reference in New Issue
Block a user