mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -73,6 +73,7 @@ namespace Jackett.Common.Services
|
||||
InitIndexers();
|
||||
InitCardigannIndexers(path);
|
||||
InitAggregateIndexer();
|
||||
RemoveLegacyConfigurations();
|
||||
}
|
||||
|
||||
private void MigrateRenamedIndexers()
|
||||
@@ -234,6 +235,23 @@ namespace Jackett.Common.Services
|
||||
};
|
||||
}
|
||||
|
||||
public void RemoveLegacyConfigurations()
|
||||
{
|
||||
var directoryInfo = new DirectoryInfo(globalConfigService.GetIndexerConfigDir());
|
||||
if (!directoryInfo.Exists)
|
||||
return; // the directory does not exist the first start
|
||||
var files = directoryInfo.GetFiles("*.json*");
|
||||
foreach (var file in files)
|
||||
{
|
||||
var indexerId = file.Name.Replace(".bak", "").Replace(".json", "");
|
||||
if (!indexers.ContainsKey(indexerId) && File.Exists(file.FullName))
|
||||
{
|
||||
logger.Info($"Removing old configuration file: {file.FullName}");
|
||||
File.Delete(file.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IIndexer GetIndexer(string name)
|
||||
{
|
||||
// old id of renamed indexer is used to maintain backward compatibility
|
||||
|
Reference in New Issue
Block a user