mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -76,10 +76,20 @@ namespace Jackett.Common.Services
|
|||||||
if (File.Exists(oldPath))
|
if (File.Exists(oldPath))
|
||||||
{
|
{
|
||||||
// if the old configuration exists, we rename it to be used by the renamed indexer
|
// if the old configuration exists, we rename it to be used by the renamed indexer
|
||||||
|
logger.Info($"Old configuration detected: {oldPath}");
|
||||||
var newPath = configService.GetIndexerConfigFilePath(renamedIndexers[oldId]);
|
var newPath = configService.GetIndexerConfigFilePath(renamedIndexers[oldId]);
|
||||||
|
if (File.Exists(newPath))
|
||||||
|
File.Delete(newPath);
|
||||||
File.Move(oldPath, newPath);
|
File.Move(oldPath, newPath);
|
||||||
if (File.Exists(oldPath + ".bak"))
|
// backups
|
||||||
File.Move(oldPath + ".bak", newPath + ".bak");
|
var oldPathBak = oldPath + ".bak";
|
||||||
|
var newPathBak = newPath + ".bak";
|
||||||
|
if (File.Exists(oldPathBak))
|
||||||
|
{
|
||||||
|
if (File.Exists(newPathBak))
|
||||||
|
File.Delete(newPathBak);
|
||||||
|
File.Move(oldPathBak, newPathBak);
|
||||||
|
}
|
||||||
logger.Info($"Configuration renamed: {oldPath} => {newPath}");
|
logger.Info($"Configuration renamed: {oldPath} => {newPath}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user