From 9f66532530ea3b595bac52f817a5474b0a0b5ffc Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Mon, 7 Dec 2020 02:08:21 +0100 Subject: [PATCH] core: remove legacy configuration files (#10416) #10392 #10415 --- .../Services/IndexerManagerService.cs | 18 ++ src/Jackett.Updater/Program.cs | 300 ------------------ 2 files changed, 18 insertions(+), 300 deletions(-) diff --git a/src/Jackett.Common/Services/IndexerManagerService.cs b/src/Jackett.Common/Services/IndexerManagerService.cs index a2f1ab88e..57aa0d34c 100644 --- a/src/Jackett.Common/Services/IndexerManagerService.cs +++ b/src/Jackett.Common/Services/IndexerManagerService.cs @@ -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 diff --git a/src/Jackett.Updater/Program.cs b/src/Jackett.Updater/Program.cs index c1a9ed26c..1dd64f277 100644 --- a/src/Jackett.Updater/Program.cs +++ b/src/Jackett.Updater/Program.cs @@ -423,306 +423,6 @@ namespace Jackett.Updater "Definitions/xtremefile.yml", "Definitions/xtremezone.yml", // migrated to C# XtremeZone base tracker "Definitions/yourexotic.yml", // renamed to exoticaz - "Indexers/32pages.json", - "Indexers/32pages.json.bak", - "Indexers/420files.json", - "Indexers/420files.json.bak", - "Indexers/academictorrents.json", - "Indexers/academictorrents.json.bak", - "Indexers/alein.json", - "Indexers/alein.json.bak", - "Indexers/alexfilm.json", - "Indexers/alexfilm.json.bak", - "Indexers/aox.json", - "Indexers/aox.json.bak", - "Indexers/apollo.json", // renamed to orpheus - "Indexers/apollo.json.bak", // renamed to orpheus - "Indexers/archetorrent.json", - "Indexers/archetorrent.json.bak", - "Indexers/asiandvdclub.json", - "Indexers/asiandvdclub.json.bak", - "Indexers/avg.json", - "Indexers/avg.json.bak", - "Indexers/b2s-share.json", - "Indexers/b2s-share.json.bak", - "Indexers/badasstorrents.json", // to be migrated to c# - "Indexers/badasstorrents.json.bak", // to be migrated to c# - "Indexers/bithq.json", - "Indexers/bithq.json.bak", - "Indexers/bitme.json", - "Indexers/bitme.json.bak", - "Indexers/bittorrentam.json", - "Indexers/bittorrentam.json.bak", - "Indexers/blubits.json", - "Indexers/blubits.json.bak", - "Indexers/brobits.json", - "Indexers/brobits.json.bak", - "Indexers/bt-scene.json", - "Indexers/bt-scene.json.bak", - "Indexers/btbit.json", - "Indexers/btbit.json.bak", - "Indexers/bteye.json", - "Indexers/bteye.json.bak", - "Indexers/btgigs.json", - "Indexers/btgigs.json.bak", - "Indexers/btkitty.json", - "Indexers/btkitty.json.bak", - "Indexers/btstornet.json", - "Indexers/btstornet.json.bak", - "Indexers/btxpress.json", - "Indexers/btxpress.json.bak", - "Indexers/cinefilhd.json", - "Indexers/cinefilhd.json.bak", - "Indexers/crazyscorner.json", - "Indexers/crazyscorner.json.bak", - "Indexers/czteam.json", - "Indexers/czteam.json.bak", - "Indexers/cztorrent.json", - "Indexers/cztorrent.json.bak", - "Indexers/demonsite.json", - "Indexers/demonsite.json.bak", - "Indexers/digbt.json", - "Indexers/digbt.json.bak", - "Indexers/downloadville.json", - "Indexers/downloadville.json.bak", - "Indexers/dragonworld.json", - "Indexers/dragonworld.json.bak", - "Indexers/dreamteam.json", - "Indexers/dreamteam.json.bak", - "Indexers/eggmeon.json", - "Indexers/eggmeon.json.bak", - "Indexers/elitehd.json", - "Indexers/elitehd.json.bak", - "Indexers/elitetorrent-biz.json", - "Indexers/elitetorrent-biz.json.bak", - "Indexers/elittracker.json", - "Indexers/elittracker.json.bak", - "Indexers/eotforum.json", - "Indexers/eotforum.json.bak", - "Indexers/estrenosdtl.json", - "Indexers/estrenosdtl.json.bak", - "Indexers/ethor.json", - "Indexers/ethor.json.bak", - "Indexers/evolutionpalace.json", - "Indexers/evolutionpalace.json.bak", - "Indexers/extratorrent-ag.json", - "Indexers/extratorrent-ag.json.bak", - "Indexers/extratorrentclone.json", - "Indexers/extratorrentclone.json.bak", - "Indexers/feedurneed.json", - "Indexers/feedurneed.json.bak", - "Indexers/filmsclub.json", - "Indexers/filmsclub.json.bak", - "Indexers/freakstrackingsystem.json", - "Indexers/freakstrackingsystem.json.bak", - "Indexers/freedomhd.json", - "Indexers/freedomhd.json.bak", - "Indexers/gdf76.json", - "Indexers/gdf76.json.bak", - "Indexers/gfxnews.json", - "Indexers/gfxnews.json.bak", - "Indexers/gods.json", - "Indexers/gods.json.bak", - "Indexers/gormogon.json", - "Indexers/gormogon.json.bak", - "Indexers/greeklegends.json", - "Indexers/greeklegends.json.bak", - "Indexers/hachede-c.json", - "Indexers/hachede-c.json.bak", - "Indexers/hd4free.json", - "Indexers/hd4free.json.bak", - "Indexers/hdbc.json", // renamed to hdbitscom - "Indexers/hdbc.json.bak", // renamed to hdbitscom - "Indexers/hdclub.json", - "Indexers/hdclub.json.bak", - "Indexers/hdplus.json", - "Indexers/hdplus.json.bak", - "Indexers/hon3yhd-net.json", - "Indexers/hon3yhd-net.json.bak", - "Indexers/horriblesubs.json", - "Indexers/horriblesubs.json.bak", - "Indexers/hyperay.json", - "Indexers/hyperay.json.bak", - "Indexers/idopeclone.json", - "Indexers/idopeclone.json.bak", - "Indexers/iloveclassics.json", - "Indexers/iloveclassics.json.bak", - "Indexers/infinityt.json", - "Indexers/infinityt.json.bak", - "Indexers/inperil.json", - "Indexers/inperil.json.bak", - "Indexers/isohunt.json", - "Indexers/isohunt.json.bak", - "Indexers/kapaki.json", - "Indexers/kapaki.json.bak", - "Indexers/katcrs.json", - "Indexers/katcrs.json.bak", - "Indexers/kaztorka.json", - "Indexers/kaztorka.json.bak", - "Indexers/kickasstorrent.json", - "Indexers/kickasstorrent.json.bak", - "Indexers/kikibt.json", - "Indexers/kikibt.json.bak", - "Indexers/korsar.json", - "Indexers/korsar.json.bak", - "Indexers/lapausetorrents.json", - "Indexers/lapausetorrents.json.bak", - "Indexers/lemencili.json", - "Indexers/lemencili.json.bak", - "Indexers/leparadisdunet.json", - "Indexers/leparadisdunet.json.bak", - "Indexers/leporno.json", - "Indexers/leporno.json.bak", - "Indexers/magnetdl.json", - "Indexers/magnetdl.json.bak", - "Indexers/maniatorrent.json", - "Indexers/maniatorrent.json.bak", - "Indexers/manicomioshare.json", - "Indexers/manicomioshare.json.bak", - "Indexers/megabliz.json", - "Indexers/megabliz.json.bak", - "Indexers/mkvcage.json", - "Indexers/mkvcage.json.bak", - "Indexers/moecat.json", - "Indexers/moecat.json.bak", - "Indexers/music-master.json", - "Indexers/music-master.json.bak", - "Indexers/nachtwerk.json", - "Indexers/nachtwerk.json.bak", - "Indexers/nexttorrent.json", - "Indexers/nexttorrent.json.bak", - "Indexers/nordichd.json", - "Indexers/nordichd.json.bak", - "Indexers/nostalgic.json", // renamed to vhstapes - "Indexers/nostalgic.json.bak", // renamed to vhstapes - "Indexers/nyaa.json", - "Indexers/nyaa.json.bak", - "Indexers/nyoo.json", - "Indexers/nyoo.json.bak", - "Indexers/passionetorrent.json", - "Indexers/passionetorrent.json.bak", - "Indexers/polishtracker.json", - "Indexers/polishtracker.json.bak", - "Indexers/pt99.json", - "Indexers/pt99.json.bak", - "Indexers/qctorrent.json", - "Indexers/qctorrent.json.bak", - "Indexers/qxr.json", - "Indexers/qxr.json.bak", - "Indexers/rapidetracker.json", - "Indexers/rapidetracker.json.bak", - "Indexers/redtopia.json", - "Indexers/redtopia.json.bak", - "Indexers/rgu.json", - "Indexers/rgu.json.bak", - "Indexers/rns.json", // site merged with audiobooktorrents - "Indexers/rns.json.bak", // site merged with audiobooktorrents - "Indexers/rockethd.json", - "Indexers/rockethd.json.bak", - "Indexers/rockhardlossless.json", - "Indexers/rockhardlossless.json.bak", - "Indexers/rodvd.json", - "Indexers/rodvd.json.bak", - "Indexers/scenereactor.json", - "Indexers/scenereactor.json.bak", - "Indexers/scenexpress.json", - "Indexers/scenexpress.json.bak", - "Indexers/seedpeer.json", - "Indexers/seedpeer.json.bak", - "Indexers/sharespacedb.json", - "Indexers/sharespacedb.json.bak", - "Indexers/sharingue.json", - "Indexers/sharingue.json.bak", - "Indexers/skytorrents.json", - "Indexers/skytorrents.json.bak", - "Indexers/soundpark.json", // to be migrated to C# - "Indexers/soundpark.json.bak", // to be migrated to C# - "Indexers/spacetorrent.json", - "Indexers/spacetorrent.json.bak", - "Indexers/speed-share.json", - "Indexers/speed-share.json.bak", - "Indexers/t411.json", - "Indexers/t411.json.bak", - "Indexers/t411v2.json", - "Indexers/t411v2.json.bak", - "Indexers/tazmaniaden.json", - "Indexers/tazmaniaden.json.bak", - "Indexers/tbplus.json", - "Indexers/tbplus.json.bak", - "Indexers/tehconnection.json", - "Indexers/tehconnection.json.bak", - "Indexers/tfile.json", - "Indexers/tfile.json.bak", - "Indexers/the-madhouse.json", - "Indexers/the-madhouse.json.bak", - "Indexers/themoviecave.json", - "Indexers/themoviecave.json.bak", - "Indexers/theresurrection.json", - "Indexers/theresurrection.json.bak", - "Indexers/thetorrents.json", - "Indexers/thetorrents.json.bak", - "Indexers/theunknown.json", // became 3evils #9678 - "Indexers/theunknown.json.bak", // became 3evils #9678 - "Indexers/tigers-dl.json", - "Indexers/tigers-dl.json.bak", - "Indexers/tntvillage.json", - "Indexers/tntvillage.json.bak", - "Indexers/topnow.json", - "Indexers/topnow.json.bak", - "Indexers/torrentcouch.json", - "Indexers/torrentcouch.json.bak", - "Indexers/torrenthane.json", - "Indexers/torrenthane.json.bak", - "Indexers/torrentkim.json", - "Indexers/torrentkim.json.bak", - "Indexers/torrentquest.json", - "Indexers/torrentquest.json.bak", - "Indexers/torrentrex.json", - "Indexers/torrentrex.json.bak", - "Indexers/torrentsmd.json", - "Indexers/torrentsmd.json.bak", - "Indexers/torrentvault.json", - "Indexers/torrentvault.json.bak", - "Indexers/torrentwal.json", - "Indexers/torrentwal.json.bak", - "Indexers/torrentwtf.json", - "Indexers/torrentwtf.json.bak", - "Indexers/torrof.json", - "Indexers/torrof.json.bak", - "Indexers/torviet.json", - "Indexers/torviet.json.bak", - "Indexers/tspate.json", - "Indexers/tspate.json.bak", - "Indexers/turknova.json", - "Indexers/turknova.json.bak", - "Indexers/u-torrents.json", - "Indexers/u-torrents.json.bak", - "Indexers/ultimategamerclub.json", - "Indexers/ultimategamerclub.json.bak", - "Indexers/ultrahdclub.json", - "Indexers/ultrahdclub.json.bak", - "Indexers/uniotaku.json", // to be migrated to c# - "Indexers/uniotaku.json.bak", // to be migrated to c# - "Indexers/utorrents.json", // same as SzeneFZ now - "Indexers/utorrents.json.bak", // same as SzeneFZ now - "Indexers/vanila.json", - "Indexers/vanila.json.bak", - "Indexers/vhstapes.json", - "Indexers/vhstapes.json.bak", - "Indexers/waffles.json", - "Indexers/waffles.json.bak", - "Indexers/world-of-tomorrow.json", // #9213 - "Indexers/world-of-tomorrow.json.bak", // #9213 - "Indexers/worldofp2p.json", - "Indexers/worldofp2p.json.bak", - "Indexers/worldwidetorrents.json", - "Indexers/worldwidetorrents.json.bak", - "Indexers/xfsub.json", - "Indexers/xfsub.json.bak", - "Indexers/xktorrent.json", - "Indexers/xktorrent.json.bak", - "Indexers/xtremefile.json", - "Indexers/xtremefile.json.bak", "Microsoft.Owin.dll", "Microsoft.Owin.FileSystems.dll", "Microsoft.Owin.Host.HttpListener.dll",