From 54e3c32c1e51cf16cfef1a62becad4fb4bb7227a Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Tue, 5 Mar 2024 21:40:14 +0000 Subject: [PATCH] assorted bespoke C#: move or add activity info to config (#15122) --- src/Jackett.Common/Indexers/AnimeTorrents.cs | 2 -- src/Jackett.Common/Indexers/AvistaZ.cs | 2 -- src/Jackett.Common/Indexers/CinemaZ.cs | 2 -- src/Jackett.Common/Indexers/MyAnonamouse.cs | 2 -- src/Jackett.Common/Indexers/NorBits.cs | 5 +---- src/Jackett.Common/Indexers/SpeedCD.cs | 2 -- .../IndexerConfig/Bespoke/ConfigurationDataAnimeTorrents.cs | 2 ++ .../IndexerConfig/Bespoke/ConfigurationDataAvistazTracker.cs | 2 ++ .../IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs | 2 ++ .../Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs | 4 ++++ .../IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs | 2 ++ .../Bespoke/ConfigurationDataSpeedAppTracker.cs | 2 ++ .../Models/IndexerConfig/Bespoke/ConfigurationDataSpeedCD.cs | 2 ++ .../Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs | 2 ++ 14 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/Jackett.Common/Indexers/AnimeTorrents.cs b/src/Jackett.Common/Indexers/AnimeTorrents.cs index 39ecfc365..4b4b9a7e9 100644 --- a/src/Jackett.Common/Indexers/AnimeTorrents.cs +++ b/src/Jackett.Common/Indexers/AnimeTorrents.cs @@ -16,7 +16,6 @@ using Jackett.Common.Utils; using Jackett.Common.Utils.Clients; using Newtonsoft.Json.Linq; using NLog; -using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -49,7 +48,6 @@ namespace Jackett.Common.Indexers cacheService: cs, configData: new ConfigurationDataAnimeTorrents()) { - configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "You must login and download at least 1 torrent per year or your account will be deleted. There is no re-activation. AnimeTorrents do not send email reminders, it is your responsibility.")); } private TorznabCapabilities SetCapabilities() diff --git a/src/Jackett.Common/Indexers/AvistaZ.cs b/src/Jackett.Common/Indexers/AvistaZ.cs index 673383b4c..ec348a1d2 100644 --- a/src/Jackett.Common/Indexers/AvistaZ.cs +++ b/src/Jackett.Common/Indexers/AvistaZ.cs @@ -6,7 +6,6 @@ using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; using NLog; -using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -30,7 +29,6 @@ namespace Jackett.Common.Indexers p: ps, cs: cs) { - configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "To avoid account deletion you must login at least 1 time every 90 days, and you must download at least 1 torrent every 6 months. Simply keeping torrents seeding long term will not protect your account. Do not rely on inactivity emails, we often do not send them.")); } private TorznabCapabilities SetCapabilities() diff --git a/src/Jackett.Common/Indexers/CinemaZ.cs b/src/Jackett.Common/Indexers/CinemaZ.cs index 359815132..66ad58d85 100644 --- a/src/Jackett.Common/Indexers/CinemaZ.cs +++ b/src/Jackett.Common/Indexers/CinemaZ.cs @@ -5,7 +5,6 @@ using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; using NLog; -using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -28,7 +27,6 @@ namespace Jackett.Common.Indexers cs: cs ) { - configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "To avoid account deletion you must login at least 1 time every 90 days, and you must download at least 1 torrent every 6 months. Simply keeping torrents seeding long term will not protect your account. Do not rely on inactivity emails, CinemaZ often do not send them.")); } private TorznabCapabilities SetCapabilities() diff --git a/src/Jackett.Common/Indexers/MyAnonamouse.cs b/src/Jackett.Common/Indexers/MyAnonamouse.cs index be902aff5..279edd7bf 100644 --- a/src/Jackett.Common/Indexers/MyAnonamouse.cs +++ b/src/Jackett.Common/Indexers/MyAnonamouse.cs @@ -13,7 +13,6 @@ using Jackett.Common.Utils.Clients; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NLog; -using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -45,7 +44,6 @@ namespace Jackett.Common.Indexers configData: new ConfigurationDataMyAnonamouse()) { webclient.EmulateBrowser = false; - configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "To prevent your account from being disabled for inactivity, you must log in on a regular basis. You must also use your account - if you do not, your account will be disabled. If you know that you will not be able to login for an extended period of time, you can park your account in your preferences and it will not be disabled.")); } private TorznabCapabilities SetCapabilities() diff --git a/src/Jackett.Common/Indexers/NorBits.cs b/src/Jackett.Common/Indexers/NorBits.cs index 56e0afedc..11c1b0f7e 100644 --- a/src/Jackett.Common/Indexers/NorBits.cs +++ b/src/Jackett.Common/Indexers/NorBits.cs @@ -18,7 +18,6 @@ using Jackett.Common.Utils; using Jackett.Common.Utils.Clients; using Newtonsoft.Json.Linq; using NLog; -using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -50,8 +49,6 @@ namespace Jackett.Common.Indexers cacheService: cs, configData: new ConfigurationDataNorbits()) { - configData.AddDynamic("freeleech", new BoolConfigurationItem("Search freeleech only") { Value = false }); - configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "Parasites are deactivated after 28 days. (7 days below 0.3 in ratio, 7 days with a warning, 14 days as a parasite). Accounts with nothing downloaded or uploaded will be deactivated after 28 days. This only applies to newly registered accounts without torrent activity (e.g. not passing the norbits test).")); } private TorznabCapabilities SetCapabilities() @@ -388,7 +385,7 @@ namespace Jackett.Common.Indexers term = "all"; } - if (((BoolConfigurationItem)configData.GetDynamic("freeleech")).Value) + if (ConfigData.freeleech.Value) { parameters.Add("FL", "1"); } diff --git a/src/Jackett.Common/Indexers/SpeedCD.cs b/src/Jackett.Common/Indexers/SpeedCD.cs index 24f141bd5..5809ff668 100644 --- a/src/Jackett.Common/Indexers/SpeedCD.cs +++ b/src/Jackett.Common/Indexers/SpeedCD.cs @@ -14,7 +14,6 @@ using Jackett.Common.Utils; using Jackett.Common.Utils.Clients; using Newtonsoft.Json.Linq; using NLog; -using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -56,7 +55,6 @@ namespace Jackett.Common.Indexers in your Speed.Cd profile. Eg. Geo Locking, your seedbox may be in a different country to the one where you login via your web browser.

For best results, change the 'Torrents per page' setting to 100 in 'Profile Settings > Torrents'.")) { - configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "Accounts not being used for 3 months will be removed to make room for active members.")); } private TorznabCapabilities SetCapabilities() diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeTorrents.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeTorrents.cs index fd678f082..a68d8dbcf 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeTorrents.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeTorrents.cs @@ -7,11 +7,13 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke { public BoolConfigurationItem FreeleechOnly { get; private set; } public BoolConfigurationItem DownloadableOnly { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataAnimeTorrents() { FreeleechOnly = new BoolConfigurationItem("Show freeleech only") { Value = false }; DownloadableOnly = new BoolConfigurationItem("Search downloadable torrents only (enable this only if your account class is Newbie)") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "You must login and download at least 1 torrent per year or your account will be deleted. There is no re-activation. AnimeTorrents do not send email reminders, it is your responsibility."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAvistazTracker.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAvistazTracker.cs index 38b4435a4..e96a77b9c 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAvistazTracker.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAvistazTracker.cs @@ -6,11 +6,13 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke internal class ConfigurationDataAvistazTracker : ConfigurationDataBasicLoginWithPID { public BoolConfigurationItem Freeleech { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataAvistazTracker() : base("You have to check 'Enable RSS Feed' in 'My Account', without this configuration the torrent download does not work.
You can find the PID in 'My profile'.") { Freeleech = new BoolConfigurationItem("Search freeleech only") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "To avoid account deletion you must login at least 1 time every 90 days, and you must download at least 1 torrent every 6 months. Simply keeping torrents seeding long term will not protect your account. Do not rely on inactivity emails, admins often do not send them."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs index 46c7ca2cd..c6bd9d06e 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs @@ -12,6 +12,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke public BoolConfigurationItem SearchInDescription { get; private set; } public BoolConfigurationItem SearchInSeries { get; private set; } public BoolConfigurationItem SearchInFilenames { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataMyAnonamouse() { @@ -32,6 +33,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke SearchInDescription = new BoolConfigurationItem("Also search text in the description") { Value = false }; SearchInSeries = new BoolConfigurationItem("Also search text in the series") { Value = false }; SearchInFilenames = new BoolConfigurationItem("Also search text in the filenames") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "To prevent your account from being disabled for inactivity, you must log in on a regular basis. You must also use your account - if you do not, your account will be disabled. If you know that you will not be able to login for an extended period of time, you can park your account in your preferences and it will not be disabled."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs index d7154cce1..0b8910fbe 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs @@ -9,9 +9,11 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke public StringConfigurationItem Username { get; private set; } public PasswordConfigurationItem Password { get; private set; } public StringConfigurationItem TwoFactorAuth { get; private set; } + public BoolConfigurationItem freeleech { get; private set; } public DisplayInfoConfigurationItem PagesWarning { get; private set; } public StringConfigurationItem Pages { get; private set; } public BoolConfigurationItem UseFullSearch { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataNorbits() { @@ -19,9 +21,11 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke Username = new StringConfigurationItem("Username") { Value = "" }; Password = new PasswordConfigurationItem("Password") { Value = "" }; TwoFactorAuth = new StringConfigurationItem("2FA Code (Optional)"); + freeleech = new BoolConfigurationItem("Search freeleech only") { Value = false }; PagesWarning = new DisplayInfoConfigurationItem("Preferences", "Preferences Configuration (Tweak your search settings),

"); Pages = new StringConfigurationItem("Max Pages to Process (Required)") { Value = "4" }; UseFullSearch = new BoolConfigurationItem("Enable search in description.") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "Parasites are deactivated after 28 days. (7 days below 0.3 in ratio, 7 days with a warning, 14 days as a parasite). Accounts with nothing downloaded or uploaded will be deactivated after 28 days. This only applies to newly registered accounts without torrent activity (e.g. not passing the norbits test)."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs index 1dd6d285e..ffb34255d 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs @@ -6,11 +6,13 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke internal class ConfigurationDataSceneTime : ConfigurationDataCookieUA { public BoolConfigurationItem Freeleech { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataSceneTime() : base("For best results, change the 'Torrents per page' setting to the maximum in your profile on the SceneTime webpage.") { Freeleech = new BoolConfigurationItem("Freeleech Only (Optional)") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "Unused accounts (accounts with no activity) may be deleted."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedAppTracker.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedAppTracker.cs index ae3a0c6ff..d76775034 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedAppTracker.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedAppTracker.cs @@ -6,10 +6,12 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke internal class ConfigurationDataSpeedAppTracker : ConfigurationDataBasicLoginWithEmail { public BoolConfigurationItem FreeleechOnly { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataSpeedAppTracker() { FreeleechOnly = new BoolConfigurationItem("Show freeleech only") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "The accounts shall not be deleted or automatically deactivated. Inactive accounts, regardless of class, will have the invitations deleted after 180 days."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedCD.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedCD.cs index 3138742d2..0804230da 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedCD.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSpeedCD.cs @@ -7,12 +7,14 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke { public BoolConfigurationItem Freeleech { get; set; } public BoolConfigurationItem ExcludeArchives { get; set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataSpeedCD(string instructionMessageOptional = null) : base(instructionMessageOptional) { Freeleech = new BoolConfigurationItem("Search freeleech only") { Value = false }; ExcludeArchives = new BoolConfigurationItem("Exclude torrents with RAR files") { Value = false }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "Accounts not being used for 3 months will be removed to make room for active members."); } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs index 042785a95..0cbeabf45 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs @@ -9,11 +9,13 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke { public StringConfigurationItem Username { get; private set; } public StringConfigurationItem Password { get; private set; } + public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataTVstore() { Username = new StringConfigurationItem("Username") { Value = "" }; Password = new StringConfigurationItem("Password") { Value = "" }; + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "If a user does not log in to the site for 100 days (Tag, Storekeeper for 1 year), it is automatically deleted."); } public ConfigurationDataTVstore(JToken json)