core: remove virtual member calls (part 2) (#8023)

This commit is contained in:
Diego Heras
2020-04-04 08:56:51 +02:00
committed by GitHub
parent 484cc35577
commit ada079dba7
17 changed files with 210 additions and 173 deletions

View File

@@ -11,6 +11,7 @@ using Jackett.Common.Models;
using Jackett.Common.Models.IndexerConfig; using Jackett.Common.Models.IndexerConfig;
using Jackett.Common.Services.Interfaces; using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils; using Jackett.Common.Utils;
using Jackett.Common.Utils.Clients;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
@@ -32,22 +33,21 @@ namespace Jackett.Common.Indexers.Abstract
// hook to adjust the search term // hook to adjust the search term
protected string GetSearchTerm(TorznabQuery query) => $"{query.SearchTerm} {query.GetEpisodeSearchString()}"; protected string GetSearchTerm(TorznabQuery query) => $"{query.SearchTerm} {query.GetEpisodeSearchString()}";
public AvistazTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link) protected AvistazTracker(string name, string link, string description, IIndexerConfigurationService configService,
: base(name: name, WebClient client, Logger logger, IProtectionService p, TorznabCapabilities caps)
description: desc, : base(name,
link: link, description: description,
caps: TorznabUtil.CreateDefaultTorznabTVCaps(), link: link,
configService: configService, caps: caps,
client: webClient, configService: configService,
logger: logger, client: client,
p: protectionService, logger: logger,
configData: new ConfigurationDataBasicLogin()) p: p,
configData: new ConfigurationDataBasicLogin())
{ {
Encoding = Encoding.UTF8; Encoding = Encoding.UTF8;
Language = "en-us"; Language = "en-us";
TorznabCaps.SupportsImdbMovieSearch = true;
AddCategoryMapping(1, TorznabCatType.Movies); AddCategoryMapping(1, TorznabCatType.Movies);
AddCategoryMapping(1, TorznabCatType.MoviesForeign); AddCategoryMapping(1, TorznabCatType.MoviesForeign);
AddCategoryMapping(1, TorznabCatType.MoviesHD); AddCategoryMapping(1, TorznabCatType.MoviesHD);

View File

@@ -23,20 +23,18 @@ namespace Jackett.Common.Indexers.Abstract
set => base.configData = value; set => base.configData = value;
} }
public CouchPotatoTracker(IIndexerConfigurationService configService, WebClient client, Logger logger, IProtectionService p, ConfigurationDataUserPasskey configData, string name, string description, string link, string endpoint) protected CouchPotatoTracker(string name, string link, string description, IIndexerConfigurationService configService,
: base(name: name, WebClient client, Logger logger, IProtectionService p, TorznabCapabilities caps,
description: description, ConfigurationData configData, string endpoint)
link: link, : base(name,
caps: new TorznabCapabilities description: description,
{ link: link,
SupportsImdbMovieSearch = true caps: caps,
}, configService: configService,
configService: configService, client: client,
client: client, logger: logger,
logger: logger, p: p,
p: p, configData: configData)
configData: configData
)
{ {
this.endpoint = endpoint; this.endpoint = endpoint;
} }

View File

@@ -13,6 +13,7 @@ using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils; using Jackett.Common.Utils;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
using WebClient = Jackett.Common.Utils.Clients.WebClient;
namespace Jackett.Common.Indexers.Abstract namespace Jackett.Common.Indexers.Abstract
{ {
@@ -34,15 +35,17 @@ namespace Jackett.Common.Indexers.Abstract
set => base.configData = value; set => base.configData = value;
} }
public GazelleTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link, bool supportsFreeleechTokens, bool imdbInTags = false, bool has2Fa = false) protected GazelleTracker(string name, string link, string description, IIndexerConfigurationService configService,
: base(name: name, WebClient client, Logger logger, IProtectionService p, TorznabCapabilities caps,
description: desc, bool supportsFreeleechTokens, bool imdbInTags = false, bool has2Fa = false)
: base(name,
description: description,
link: link, link: link,
caps: new TorznabCapabilities(), caps: caps,
configService: configService, configService: configService,
client: webClient, client: client,
logger: logger, logger: logger,
p: protectionService, p: p,
configData: new ConfigurationDataBasicLogin()) configData: new ConfigurationDataBasicLogin())
{ {
Encoding = Encoding.UTF8; Encoding = Encoding.UTF8;

View File

@@ -1,21 +1,30 @@
using Jackett.Common.Indexers.Abstract; using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models; using Jackett.Common.Models;
using Jackett.Common.Services.Interfaces; using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils.Clients;
using NLog; using NLog;
namespace Jackett.Common.Indexers namespace Jackett.Common.Indexers
{ {
public class AlphaRatio : GazelleTracker public class AlphaRatio : GazelleTracker
{ {
public AlphaRatio(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, public AlphaRatio(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
IProtectionService protectionService) : base( : base("AlphaRatio",
name: "AlphaRatio", desc: "AlphaRatio (AR) is a Private Torrent Tracker for 0DAY / GENERAL", description: "AlphaRatio (AR) is a Private Torrent Tracker for 0DAY / GENERAL",
link: "https://alpharatio.cc/", configService: configService, logger: logger, link: "https://alpharatio.cc/",
protectionService: protectionService, webClient: webClient, supportsFreeleechTokens: true, imdbInTags: true) caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
},
configService: configService,
client: wc,
logger: l,
p: ps,
supportsFreeleechTokens: true,
imdbInTags: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";
TorznabCaps.SupportsImdbMovieSearch = true;
AddCategoryMapping(1, TorznabCatType.TVSD, "TvSD"); AddCategoryMapping(1, TorznabCatType.TVSD, "TvSD");
AddCategoryMapping(2, TorznabCatType.TVHD, "TvHD"); AddCategoryMapping(2, TorznabCatType.TVHD, "TvHD");

View File

@@ -12,16 +12,16 @@ namespace Jackett.Common.Indexers
"https://tehconnection.me/", "https://tehconnection.me/",
}; };
public TehConnectionMe(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public TehConnectionMe(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "Anthelion", // old name: TehConnection.me : base("Anthelion", // old name: TehConnection.me
desc: "A movies tracker", description: "A movies tracker",
link: "https://anthelion.me/", link: "https://anthelion.me/",
configService: configService, caps: new TorznabCapabilities(),
logger: logger, configService: configService,
protectionService: protectionService, client: wc,
webClient: webClient, logger: l,
supportsFreeleechTokens: true p: ps,
) supportsFreeleechTokens: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";

View File

@@ -1,4 +1,5 @@
using Jackett.Common.Indexers.Abstract; using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
using Jackett.Common.Services.Interfaces; using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils.Clients; using Jackett.Common.Utils.Clients;
using NLog; using NLog;
@@ -7,14 +8,18 @@ namespace Jackett.Common.Indexers
{ {
public class Avistaz : AvistazTracker public class Avistaz : AvistazTracker
{ {
public Avistaz(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public Avistaz(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "Avistaz", : base("Avistaz",
desc: "Aka AsiaTorrents", description: "Aka AsiaTorrents",
link: "https://avistaz.to/", link: "https://avistaz.to/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportsImdbMovieSearch = true
webClient: webClient) },
configService: configService,
client: wc,
logger: l,
p: ps)
=> Type = "private"; => Type = "private";
} }
} }

View File

@@ -8,16 +8,16 @@ namespace Jackett.Common.Indexers
{ {
public class BrokenStones : GazelleTracker public class BrokenStones : GazelleTracker
{ {
public BrokenStones(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public BrokenStones(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "BrokenStones", : base("BrokenStones",
desc: "Broken Stones is a Private site for MacOS and iOS APPS / GAMES", description: "Broken Stones is a Private site for MacOS and iOS APPS / GAMES",
link: "https://brokenstones.club/", link: "https://brokenstones.club/",
configService: configService, caps: new TorznabCapabilities(),
logger: logger, configService: configService,
protectionService: protectionService, client: wc,
webClient: webClient, logger: l,
supportsFreeleechTokens: true p: ps,
) supportsFreeleechTokens: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";

View File

@@ -1,4 +1,5 @@
using Jackett.Common.Indexers.Abstract; using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
using Jackett.Common.Services.Interfaces; using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils.Clients; using Jackett.Common.Utils.Clients;
using NLog; using NLog;
@@ -7,15 +8,18 @@ namespace Jackett.Common.Indexers
{ {
public class CinemaZ : AvistazTracker public class CinemaZ : AvistazTracker
{ {
public CinemaZ(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public CinemaZ(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "CinemaZ", : base("CinemaZ",
desc: "Part of the Avistaz network.", description: "Part of the Avistaz network.",
link: "https://cinemaz.to/", link: "https://cinemaz.to/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportsImdbMovieSearch = true
webClient: webClient },
) configService: configService,
client: wc,
logger: l,
p: ps)
=> Type = "private"; => Type = "private";
} }
} }

View File

@@ -23,17 +23,23 @@ namespace Jackett.Common.Indexers
set => base.configData = value; set => base.configData = value;
} }
public DanishBits(IIndexerConfigurationService configService, WebClient c, Logger l, IProtectionService ps) public DanishBits(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "DanishBits", : base("DanishBits",
description: "A danish closed torrent tracker", description: "A danish closed torrent tracker",
link: "https://danishbits.org/", link: "https://danishbits.org/",
endpoint: "couchpotato.php", caps: new TorznabCapabilities
configService: configService, {
client: c, SupportsImdbMovieSearch = true
logger: l, },
p: ps, configService: configService,
configData: new ConfigurationDataUserPasskey("Note about Passkey: This is not your login Password. Find the Passkey by logging into DanishBits with your Browser, and under your account page you'll see your passkey under the 'Personal' section on the left side.") client: wc,
) logger: l,
p: ps,
configData: new ConfigurationDataUserPasskey(
@"Note about Passkey: This is not your login Password. Find the Passkey by logging into
DanishBits with your Browser, and under your account page you'll see your passkey under the 'Personal'
section on the left side."),
endpoint: "couchpotato.php")
{ {
Encoding = Encoding.UTF8; Encoding = Encoding.UTF8;
Language = "da-dk"; Language = "da-dk";

View File

@@ -10,16 +10,16 @@ namespace Jackett.Common.Indexers
{ {
public class HDOnly : GazelleTracker public class HDOnly : GazelleTracker
{ {
public HDOnly(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public HDOnly(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "HD-Only", : base("HD-Only",
desc: "HD-Only (HD-O) is a FRENCH Private Torrent Tracker for HD MOVIES / TV", description: "HD-Only (HD-O) is a FRENCH Private Torrent Tracker for HD MOVIES / TV",
link: "https://hd-only.org/", link: "https://hd-only.org/",
configService: configService, caps: new TorznabCapabilities(),
logger: logger, configService: configService,
protectionService: protectionService, client: wc,
webClient: webClient, logger: l,
supportsFreeleechTokens: false // ratiofree p: ps,
) supportsFreeleechTokens: false) // ratiofree
{ {
Language = "fr-fr"; Language = "fr-fr";
Type = "private"; Type = "private";

View File

@@ -9,21 +9,23 @@ namespace Jackett.Common.Indexers
{ {
public class Orpheus : GazelleTracker public class Orpheus : GazelleTracker
{ {
public Orpheus(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public Orpheus(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "Orpheus", : base("Orpheus",
desc: "A music tracker", description: "A music tracker",
link: "https://orpheus.network/", link: "https://orpheus.network/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
webClient: webClient, },
supportsFreeleechTokens: true, configService: configService,
has2Fa: true client: wc,
) logger: l,
p: ps,
supportsFreeleechTokens: true,
has2Fa: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";
TorznabCaps.SupportedMusicSearchParamsList = new List<string>() { "q", "album", "artist", "label", "year" };
AddCategoryMapping(1, TorznabCatType.Audio, "Music"); AddCategoryMapping(1, TorznabCatType.Audio, "Music");
AddCategoryMapping(2, TorznabCatType.PC, "Applications"); AddCategoryMapping(2, TorznabCatType.PC, "Applications");

View File

@@ -1,21 +1,25 @@
using Jackett.Common.Indexers.Abstract; using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
using Jackett.Common.Services.Interfaces; using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils.Clients; using Jackett.Common.Utils.Clients;
using NLog; using NLog;
namespace Jackett.Common.Indexers namespace Jackett.Common.Indexers
{ {
public class PrivateHD : AvistazTracker, IIndexer public class PrivateHD : AvistazTracker
{ {
public PrivateHD(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public PrivateHD(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "PrivateHD", : base("PrivateHD",
desc: "BitTorrent site for High Quality, High Definition (HD) movies and TV Shows", description: "BitTorrent site for High Quality, High Definition (HD) movies and TV Shows",
link: "https://privatehd.to/", link: "https://privatehd.to/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportsImdbMovieSearch = true
webClient: webClient },
) configService: configService,
client: wc,
logger: l,
p: ps)
=> Type = "private"; => Type = "private";
} }
} }

View File

@@ -9,16 +9,16 @@ namespace Jackett.Common.Indexers
{ {
public class Psytorrents : GazelleTracker public class Psytorrents : GazelleTracker
{ {
public Psytorrents(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public Psytorrents(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "Psytorrents", : base("Psytorrents",
desc: "Psytorrents (PSY) is a Private Torrent Tracker for ELECTRONIC MUSIC", description: "Psytorrents (PSY) is a Private Torrent Tracker for ELECTRONIC MUSIC",
link: "https://psytorrents.info/", link: "https://psytorrents.info/",
configService: configService, caps: new TorznabCapabilities(),
logger: logger, configService: configService,
protectionService: protectionService, client: wc,
webClient: webClient, logger: l,
supportsFreeleechTokens: true p: ps,
) supportsFreeleechTokens: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";

View File

@@ -9,21 +9,23 @@ namespace Jackett.Common.Indexers
{ {
public class PassTheHeadphones : GazelleTracker public class PassTheHeadphones : GazelleTracker
{ {
public PassTheHeadphones(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public PassTheHeadphones(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "Redacted", : base("Redacted",
desc: "A music tracker", description: "A music tracker",
link: "https://redacted.ch/", link: "https://redacted.ch/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
webClient: webClient, },
supportsFreeleechTokens: true, configService: configService,
has2Fa: true client: wc,
) logger: l,
p: ps,
supportsFreeleechTokens: true,
has2Fa: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";
TorznabCaps.SupportedMusicSearchParamsList = new List<string>() { "q", "album", "artist", "label", "year" };
AddCategoryMapping(1, TorznabCatType.Audio, "Music"); AddCategoryMapping(1, TorznabCatType.Audio, "Music");
AddCategoryMapping(2, TorznabCatType.PC, "Applications"); AddCategoryMapping(2, TorznabCatType.PC, "Applications");

View File

@@ -10,21 +10,23 @@ namespace Jackett.Common.Indexers
{ {
public class SecretCinema : GazelleTracker public class SecretCinema : GazelleTracker
{ {
public SecretCinema(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public SecretCinema(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "Secret Cinema", : base("Secret Cinema",
desc: "A tracker for rare movies.", description: "A tracker for rare movies.",
link: "https://secret-cinema.pw/", link: "https://secret-cinema.pw/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportsImdbMovieSearch = true,
webClient: webClient, SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
supportsFreeleechTokens: false // ratio free tracker },
) configService: configService,
client: wc,
logger: l,
p: ps,
supportsFreeleechTokens: false) // ratioless tracker
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";
TorznabCaps.SupportedMusicSearchParamsList = new List<string>() { "q", "album", "artist", "label", "year" };
TorznabCaps.SupportsImdbMovieSearch = true;
AddCategoryMapping(1, TorznabCatType.Movies, "Movies"); AddCategoryMapping(1, TorznabCatType.Movies, "Movies");
AddCategoryMapping(2, TorznabCatType.Audio, "Music"); AddCategoryMapping(2, TorznabCatType.Audio, "Music");

View File

@@ -8,16 +8,16 @@ namespace Jackett.Common.Indexers
{ {
public class CGPeers : GazelleTracker public class CGPeers : GazelleTracker
{ {
public CGPeers(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public CGPeers(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "CGPeers", : base("CGPeers",
desc: "CGPeers is a Private Torrent Tracker for GRAPHICS SOFTWARE / TUTORIALS / ETC", description: "CGPeers is a Private Torrent Tracker for GRAPHICS SOFTWARE / TUTORIALS / ETC",
link: "https://www.cgpeers.com/", link: "https://www.cgpeers.com/",
configService: configService, caps: new TorznabCapabilities(),
logger: logger, configService: configService,
protectionService: protectionService, client: wc,
webClient: webClient, logger: l,
supportsFreeleechTokens: true p: ps,
) supportsFreeleechTokens: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";

View File

@@ -9,20 +9,22 @@ namespace Jackett.Common.Indexers
{ {
public class notwhatcd : GazelleTracker public class notwhatcd : GazelleTracker
{ {
public notwhatcd(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) public notwhatcd(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(name: "notwhat.cd", : base("notwhat.cd",
desc: "A music tracker", description: "A music tracker",
link: "https://notwhat.cd/", link: "https://notwhat.cd/",
configService: configService, caps: new TorznabCapabilities
logger: logger, {
protectionService: protectionService, SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
webClient: webClient, },
supportsFreeleechTokens: true configService: configService,
) client: wc,
logger: l,
p: ps,
supportsFreeleechTokens: true)
{ {
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";
TorznabCaps.SupportedMusicSearchParamsList = new List<string>() { "q", "album", "artist", "label", "year" };
AddCategoryMapping(1, TorznabCatType.Audio, "Music"); AddCategoryMapping(1, TorznabCatType.Audio, "Music");
AddCategoryMapping(2, TorznabCatType.PC, "Applications"); AddCategoryMapping(2, TorznabCatType.PC, "Applications");