diff --git a/src/Jackett.Common/Indexers/Abnormal.cs b/src/Jackett.Common/Indexers/Abnormal.cs index 287ef09ba..ea4ff3c7e 100644 --- a/src/Jackett.Common/Indexers/Abnormal.cs +++ b/src/Jackett.Common/Indexers/Abnormal.cs @@ -147,7 +147,7 @@ namespace Jackett.Common.Indexers } // Getting login form to retrieve CSRF token - var myRequest = new Utils.Clients.WebRequest() + var myRequest = new Utils.Clients.WebRequest { Url = LoginUrl }; @@ -164,7 +164,7 @@ namespace Jackett.Common.Indexers }; // Do the login - var request = new Utils.Clients.WebRequest() + var request = new Utils.Clients.WebRequest { PostData = pairs, Referer = LoginUrl, diff --git a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs index d9c45db35..a04a724d2 100644 --- a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs @@ -103,7 +103,7 @@ namespace Jackett.Common.Indexers.Abstract var pairs = new Dictionary { { "username", configData.Username.Value }, { "password", configData.Password.Value }, - { "keeplogged", "1"}, + { "keeplogged", "1"} }; if (!string.IsNullOrWhiteSpace(cookie)) diff --git a/src/Jackett.Common/Indexers/AniDUB.cs b/src/Jackett.Common/Indexers/AniDUB.cs index 06704d8c2..dd791a6af 100644 --- a/src/Jackett.Common/Indexers/AniDUB.cs +++ b/src/Jackett.Common/Indexers/AniDUB.cs @@ -86,7 +86,7 @@ namespace Jackett.Common.Indexers { "/dorama/korea_dorama", "7" }, { "/dorama/china_dorama", "8" }, { "/dorama", "9" }, - { "/anons_ongoing", "12" }, + { "/anons_ongoing", "12" } }; private static ICollection DefaultSearchCategories => new[] { "0" }; @@ -574,7 +574,7 @@ namespace Jackett.Common.Indexers { "beforeafter", "after" }, { "sortby", "" }, { "resorder", "desc" }, - { "showposts", "1" }, + { "showposts", "1" } }; data.AddRange(PrepareCategoriesQuery(query)); diff --git a/src/Jackett.Common/Indexers/AniLibria.cs b/src/Jackett.Common/Indexers/AniLibria.cs index 83f360707..932a056c2 100644 --- a/src/Jackett.Common/Indexers/AniLibria.cs +++ b/src/Jackett.Common/Indexers/AniLibria.cs @@ -68,7 +68,7 @@ namespace Jackett.Common.Indexers var queryParameters = new NameValueCollection { { "search", query.SearchTerm }, - { "filter", "names,poster.url,code,torrents.list,season.year" }, + { "filter", "names,poster.url,code,torrents.list,season.year" } }; var response = await RequestWithCookiesAndRetryAsync(Configuration.ApiLink.Value + "/searchTitles?" + queryParameters.GetQueryString()); if (response.Status != HttpStatusCode.OK) @@ -83,7 +83,7 @@ namespace Jackett.Common.Indexers var queryParameters = new NameValueCollection { { "limit", "100" }, - { "filter", "names,poster.url,code,torrents.list,season.year" }, + { "filter", "names,poster.url,code,torrents.list,season.year" } }; var response = await RequestWithCookiesAndRetryAsync(Configuration.ApiLink.Value + "/getUpdates?" + queryParameters.GetQueryString()); if (response.Status != HttpStatusCode.OK) diff --git a/src/Jackett.Common/Indexers/Anidex.cs b/src/Jackett.Common/Indexers/Anidex.cs index c6e58b6f0..a2a6be664 100644 --- a/src/Jackett.Common/Indexers/Anidex.cs +++ b/src/Jackett.Common/Indexers/Anidex.cs @@ -64,8 +64,8 @@ namespace Jackett.Common.Indexers AddCategoryMapping(16, TorznabCatType.TVAnime, "Other"); // Configure the language select option - var languageSelect = new SelectItem(new Dictionary() - { + var languageSelect = new SelectItem(new Dictionary + { {"1", "English"}, {"2", "Japanese"}, {"3", "Polish"}, @@ -102,8 +102,8 @@ namespace Jackett.Common.Indexers configData.AddDynamic("languageid", languageSelect); // Configure the sort selects - var sortBySelect = new SelectItem(new Dictionary() - { + var sortBySelect = new SelectItem(new Dictionary + { {"upload_timestamp", "created"}, {"seeders", "seeders"}, {"size", "size"}, @@ -112,7 +112,7 @@ namespace Jackett.Common.Indexers { Name = "Sort by", Value = "upload_timestamp" }; configData.AddDynamic("sortrequestedfromsite", sortBySelect); - var orderSelect = new SelectItem(new Dictionary() + var orderSelect = new SelectItem(new Dictionary { {"desc", "Descending"}, {"asc", "Ascending"} @@ -146,7 +146,7 @@ namespace Jackett.Common.Indexers { "q", query.SearchTerm ?? string.Empty }, { "s", GetSortBy }, { "o", GetOrder }, - { "group", "0" }, // No group + { "group", "0" } // No group }; // Get specified categories diff --git a/src/Jackett.Common/Indexers/AnimeBytes.cs b/src/Jackett.Common/Indexers/AnimeBytes.cs index ae839455d..58b39d59b 100644 --- a/src/Jackett.Common/Indexers/AnimeBytes.cs +++ b/src/Jackett.Common/Indexers/AnimeBytes.cs @@ -183,7 +183,7 @@ namespace Jackett.Common.Indexers var response = await RequestWithCookiesAndRetryAsync(queryUrl); if (!response.ContentString.StartsWith("{")) // not JSON => error throw new ExceptionWithConfigData("unexcepted response (not JSON)", configData); - dynamic json = JsonConvert.DeserializeObject(response.ContentString); + var json = JsonConvert.DeserializeObject(response.ContentString); // Parse try @@ -216,7 +216,7 @@ namespace Jackett.Common.Indexers { if (group["Synonymns"] is JArray) { - List allSyonyms = group["Synonymns"].ToObject>(); + var allSyonyms = group["Synonymns"].ToObject>(); if (AddJapaneseTitle && allSyonyms.Count >= 1) synonyms.Add(allSyonyms[0]); @@ -226,7 +226,7 @@ namespace Jackett.Common.Indexers synonyms.AddRange(allSyonyms[2].Split(',').Select(t => t.Trim())); } else { - Dictionary allSynonyms = group["Synonymns"].ToObject>(); + var allSynonyms = group["Synonymns"].ToObject>(); if (AddJapaneseTitle && allSynonyms.ContainsKey(0)) synonyms.Add(allSynonyms[0]); diff --git a/src/Jackett.Common/Indexers/AnimeTorrents.cs b/src/Jackett.Common/Indexers/AnimeTorrents.cs index 621d099d0..a95f7b48a 100644 --- a/src/Jackett.Common/Indexers/AnimeTorrents.cs +++ b/src/Jackett.Common/Indexers/AnimeTorrents.cs @@ -121,7 +121,7 @@ namespace Jackett.Common.Indexers }; searchUrl += "?" + queryCollection.GetQueryString(); - var extraHeaders = new Dictionary() + var extraHeaders = new Dictionary { { "X-Requested-With", "XMLHttpRequest" } }; diff --git a/src/Jackett.Common/Indexers/Animedia.cs b/src/Jackett.Common/Indexers/Animedia.cs index f902fb0e8..ad43f06d2 100644 --- a/src/Jackett.Common/Indexers/Animedia.cs +++ b/src/Jackett.Common/Indexers/Animedia.cs @@ -132,7 +132,7 @@ namespace Jackett.Common.Indexers Comments = uri, DownloadVolumeFactor = 0, UploadVolumeFactor = 1, - Category = new int[]{ TorznabCatType.TVAnime.ID }, + Category = new[]{ TorznabCatType.TVAnime.ID } }; foreach (var t in document.QuerySelectorAll("ul.media__tabs__nav > li > a")) { diff --git a/src/Jackett.Common/Indexers/Anthelion.cs b/src/Jackett.Common/Indexers/Anthelion.cs index 39becd1a4..391eae544 100644 --- a/src/Jackett.Common/Indexers/Anthelion.cs +++ b/src/Jackett.Common/Indexers/Anthelion.cs @@ -27,7 +27,7 @@ namespace Jackett.Common.Indexers private new ConfigurationDataBasicLogin configData => (ConfigurationDataBasicLogin)base.configData; public override string[] LegacySiteLinks { get; protected set; } = { - "https://tehconnection.me/", + "https://tehconnection.me/" }; public Anthelion(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps) diff --git a/src/Jackett.Common/Indexers/BB.cs b/src/Jackett.Common/Indexers/BB.cs index a776c3e1a..a12a1387e 100644 --- a/src/Jackett.Common/Indexers/BB.cs +++ b/src/Jackett.Common/Indexers/BB.cs @@ -111,7 +111,7 @@ namespace Jackett.Common.Indexers protected override async Task> PerformQuery(TorznabQuery query) { var releases = new List(); - var searchStrings = new List(new string[] { query.GetQueryString() }); + var searchStrings = new List(new[] { query.GetQueryString() }); if (string.IsNullOrEmpty(query.Episode) && (query.Season > 0)) // Tracker naming rules: If query is for a whole season, "Season #" instead of "S##". @@ -163,7 +163,7 @@ namespace Jackett.Common.Indexers release.MinimumRatio = 1; release.MinimumSeedTime = 172800; // 48 hours - var catStr = row.Children[0].FirstElementChild.GetAttribute("href").Split(new char[] { '[', ']' })[1]; + var catStr = row.Children[0].FirstElementChild.GetAttribute("href").Split(new[] { '[', ']' })[1]; release.Category = MapTrackerCatToNewznab(catStr); var qDetails = row.Children[1].QuerySelector("a[title='View Torrent']"); diff --git a/src/Jackett.Common/Indexers/BJShare.cs b/src/Jackett.Common/Indexers/BJShare.cs index 8255d7a00..f575759fe 100644 --- a/src/Jackett.Common/Indexers/BJShare.cs +++ b/src/Jackett.Common/Indexers/BJShare.cs @@ -180,7 +180,7 @@ namespace Jackett.Common.Indexers private string FixYearPosition(string title, string year) { - int index = title.LastIndexOf('-'); + var index = title.LastIndexOf('-'); // If its a series if (index != -1) { diff --git a/src/Jackett.Common/Indexers/BakaBT.cs b/src/Jackett.Common/Indexers/BakaBT.cs index 6db5d4ed1..ea31e16a4 100644 --- a/src/Jackett.Common/Indexers/BakaBT.cs +++ b/src/Jackett.Common/Indexers/BakaBT.cs @@ -79,7 +79,7 @@ namespace Jackett.Common.Indexers private async Task DoLogin() { - var loginForm = await webclient.GetResultAsync(new Utils.Clients.WebRequest() + var loginForm = await webclient.GetResultAsync(new Utils.Clients.WebRequest { Url = LoginUrl, Type = RequestType.GET @@ -157,7 +157,7 @@ namespace Jackett.Common.Indexers currentCategories = GetNextCategory(row, currentCategories); - var stringSeparator = new string[] { " | " }; + var stringSeparator = new[] { " | " }; var titles = titleSeries.Split(stringSeparator, StringSplitOptions.RemoveEmptyEntries); if (titles.Count() > 1 && !AddRomajiTitle) titles = titles.Skip(1).ToArray(); @@ -233,7 +233,7 @@ namespace Jackett.Common.Indexers private ICollection GetNextCategory(IElement row, ICollection currentCategories) { - string nextCategoryName = GetCategoryName(row); + var nextCategoryName = GetCategoryName(row); if (nextCategoryName != null) { currentCategories = MapTrackerCatDescToNewznab(nextCategoryName); diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index 65cf9e7af..3b3c035d6 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -22,7 +22,7 @@ namespace Jackett.Common.Indexers public string SiteLink { get; protected set; } public virtual string[] LegacySiteLinks { get; protected set; } public string DefaultSiteLink { get; protected set; } - public virtual string[] AlternativeSiteLinks { get; protected set; } = new string[] { }; + public virtual string[] AlternativeSiteLinks { get; protected set; } = { }; public string DisplayDescription { get; protected set; } public string DisplayName { get; protected set; } public string Language { get; protected set; } @@ -459,7 +459,7 @@ namespace Jackett.Common.Indexers protected async Task RequestLoginAndFollowRedirect(string url, IEnumerable> data, string cookies, bool returnCookiesFromFirstCall, string redirectUrlOverride = null, string referer = null, bool accumulateCookies = false) { - var request = new WebRequest() + var request = new WebRequest { Url = url, Type = RequestType.POST, @@ -566,7 +566,7 @@ namespace Jackett.Common.Indexers redirRequestCookies = (overrideCookies != null ? overrideCookies : ""); } // Do redirect - var redirectedResponse = await webclient.GetResultAsync(new WebRequest() + var redirectedResponse = await webclient.GetResultAsync(new WebRequest { Url = overrideRedirectUrl ?? incomingResponse.RedirectingTo, Referer = referrer, diff --git a/src/Jackett.Common/Indexers/CGPeers.cs b/src/Jackett.Common/Indexers/CGPeers.cs index 98f0ed09f..f007136c7 100644 --- a/src/Jackett.Common/Indexers/CGPeers.cs +++ b/src/Jackett.Common/Indexers/CGPeers.cs @@ -10,8 +10,8 @@ namespace Jackett.Common.Indexers [ExcludeFromCodeCoverage] public class CGPeers : GazelleTracker { - public override string[] LegacySiteLinks { get; protected set; } = new string[] { - "https://www.cgpeers.com/", + public override string[] LegacySiteLinks { get; protected set; } = { + "https://www.cgpeers.com/" }; public CGPeers(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps) diff --git a/src/Jackett.Common/Indexers/CardigannIndexer.cs b/src/Jackett.Common/Indexers/CardigannIndexer.cs index b2e1259dc..560492d6b 100644 --- a/src/Jackett.Common/Indexers/CardigannIndexer.cs +++ b/src/Jackett.Common/Indexers/CardigannIndexer.cs @@ -37,7 +37,7 @@ namespace Jackett.Common.Indexers set => base.configData = value; } - protected readonly string[] OptionalFields = new string[] { "imdb", "rageid", "tvdbid", "banner" }; + protected readonly string[] OptionalFields = { "imdb", "rageid", "tvdbid", "banner" }; private static readonly string[] _SupportedLogicFunctions = { @@ -1301,7 +1301,7 @@ namespace Jackett.Common.Indexers var rawStr = applyGoTemplateText(Input.Value, variables, WebUtility.UrlEncode); foreach (var part in rawStr.Split('&')) { - var parts = part.Split(new char[] { '=' }, 2); + var parts = part.Split(new[] { '=' }, 2); var key = parts[0]; if (key.Length == 0) continue; diff --git a/src/Jackett.Common/Indexers/DanishBits.cs b/src/Jackett.Common/Indexers/DanishBits.cs index 720ddbe85..4323283f3 100644 --- a/src/Jackett.Common/Indexers/DanishBits.cs +++ b/src/Jackett.Common/Indexers/DanishBits.cs @@ -15,8 +15,8 @@ namespace Jackett.Common.Indexers [ExcludeFromCodeCoverage] public class DanishBits : CouchPotatoTracker { - public override string[] LegacySiteLinks { get; protected set; } = new string[] { - "http://danishbits.org/", + public override string[] LegacySiteLinks { get; protected set; } = { + "http://danishbits.org/" }; private new ConfigurationDataUserPasskey configData diff --git a/src/Jackett.Common/Indexers/DigitalCore.cs b/src/Jackett.Common/Indexers/DigitalCore.cs index ce63a8144..8d1ddc814 100644 --- a/src/Jackett.Common/Indexers/DigitalCore.cs +++ b/src/Jackett.Common/Indexers/DigitalCore.cs @@ -149,7 +149,7 @@ namespace Jackett.Common.Indexers try { //var json = JArray.Parse(results.Content); - dynamic json = JsonConvert.DeserializeObject(results.ContentString); + var json = JsonConvert.DeserializeObject(results.ContentString); foreach (var row in json ?? Enumerable.Empty()) { var release = new ReleaseInfo(); diff --git a/src/Jackett.Common/Indexers/DivxTotal.cs b/src/Jackett.Common/Indexers/DivxTotal.cs index f97f49d53..bad8ec936 100644 --- a/src/Jackett.Common/Indexers/DivxTotal.cs +++ b/src/Jackett.Common/Indexers/DivxTotal.cs @@ -70,7 +70,7 @@ namespace Jackett.Common.Indexers Language = "es-es"; Type = "public"; - var matchWords = new BoolItem() { Name = "Match words in title", Value = true }; + var matchWords = new BoolItem { Name = "Match words in title", Value = true }; configData.AddDynamic("MatchWords", matchWords); AddCategoryMapping(DivxTotalCategories.Peliculas, TorznabCatType.MoviesSD); @@ -313,7 +313,7 @@ namespace Jackett.Common.Indexers Seeders = 1, Peers = 2, DownloadVolumeFactor = 0, - UploadVolumeFactor = 1, + UploadVolumeFactor = 1 }; releases.Add(release); } diff --git a/src/Jackett.Common/Indexers/EpubLibre.cs b/src/Jackett.Common/Indexers/EpubLibre.cs index 381b4e39c..06c52dcd9 100644 --- a/src/Jackett.Common/Indexers/EpubLibre.cs +++ b/src/Jackett.Common/Indexers/EpubLibre.cs @@ -25,7 +25,7 @@ namespace Jackett.Common.Indexers private const int MaxSearchPageLimit = 6; // 18 items per page * 6 pages = 108 private readonly Dictionary _apiHeaders = new Dictionary { - {"X-Requested-With", "XMLHttpRequest"}, + {"X-Requested-With", "XMLHttpRequest"} }; private readonly Dictionary _languages = new Dictionary { diff --git a/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs b/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs index bcf8b28f4..d44fe69a6 100644 --- a/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs +++ b/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs @@ -63,7 +63,7 @@ namespace Jackett.Common.Indexers.Feeds Seeders = seeders, Peers = peers, InfoHash = attributes.First(e => e.Attribute("name").Value == "infohash").Attribute("value").Value, - MagnetUri = new Uri(attributes.First(e => e.Attribute("name").Value == "magneturl").Attribute("value").Value), + MagnetUri = new Uri(attributes.First(e => e.Attribute("name").Value == "magneturl").Attribute("value").Value) }; return release; } diff --git a/src/Jackett.Common/Indexers/FileList.cs b/src/Jackett.Common/Indexers/FileList.cs index 3fe901ec0..f67eda7ba 100644 --- a/src/Jackett.Common/Indexers/FileList.cs +++ b/src/Jackett.Common/Indexers/FileList.cs @@ -22,7 +22,7 @@ namespace Jackett.Common.Indexers "http://filelist.ro/", "https://filelist.ro/", "https://flro.org/", - "http://flro.org/", + "http://flro.org/" }; private string ApiUrl => SiteLink + "api.php"; diff --git a/src/Jackett.Common/Indexers/FunFile.cs b/src/Jackett.Common/Indexers/FunFile.cs index a13fc7e06..60974d909 100644 --- a/src/Jackett.Common/Indexers/FunFile.cs +++ b/src/Jackett.Common/Indexers/FunFile.cs @@ -70,7 +70,7 @@ namespace Jackett.Common.Indexers var pairs = new Dictionary { { "username", configData.Username.Value }, { "password", configData.Password.Value }, - { "login", "Login" }, + { "login", "Login" } }; var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl); diff --git a/src/Jackett.Common/Indexers/Fuzer.cs b/src/Jackett.Common/Indexers/Fuzer.cs index aed4c42d1..d31e2911a 100644 --- a/src/Jackett.Common/Indexers/Fuzer.cs +++ b/src/Jackett.Common/Indexers/Fuzer.cs @@ -276,7 +276,7 @@ namespace Jackett.Common.Indexers {"searchseriesid", ""}, {"tab", "listseries"}, {"function", "Search"}, - {"string", searchTerm}, // eretz + nehedert + {"string", searchTerm} // eretz + nehedert }; var site = new UriBuilder { diff --git a/src/Jackett.Common/Indexers/GazelleGames.cs b/src/Jackett.Common/Indexers/GazelleGames.cs index 166b0b244..9d4d755f5 100644 --- a/src/Jackett.Common/Indexers/GazelleGames.cs +++ b/src/Jackett.Common/Indexers/GazelleGames.cs @@ -46,7 +46,7 @@ namespace Jackett.Common.Indexers Language = "en-us"; Type = "private"; - configData.AddDynamic("searchgroupnames", new BoolItem() { Name = "Search Group Names Only", Value = false }); + configData.AddDynamic("searchgroupnames", new BoolItem { Name = "Search Group Names Only", Value = false }); // Apple AddCategoryMapping("Mac", TorznabCatType.ConsoleOther, "Mac"); @@ -316,7 +316,7 @@ namespace Jackett.Common.Indexers Title = title, Description = qDescription?.TextContent, UploadVolumeFactor = qNeutralLeech is null ? 1 : 0, - DownloadVolumeFactor = qFreeLeech != null || qNeutralLeech != null ? 0 : 1, + DownloadVolumeFactor = qFreeLeech != null || qNeutralLeech != null ? 0 : 1 }; releases.Add(release); } diff --git a/src/Jackett.Common/Indexers/HDBitsApi.cs b/src/Jackett.Common/Indexers/HDBitsApi.cs index 6c4b5485e..5deb3d2c2 100644 --- a/src/Jackett.Common/Indexers/HDBitsApi.cs +++ b/src/Jackett.Common/Indexers/HDBitsApi.cs @@ -39,7 +39,7 @@ namespace Jackett.Common.Indexers MovieSearchParams = new List { MovieSearchParam.Q, MovieSearchParam.ImdbId - }, + } }, configService: configService, client: wc, diff --git a/src/Jackett.Common/Indexers/ImmortalSeed.cs b/src/Jackett.Common/Indexers/ImmortalSeed.cs index 82086f1e4..8a0194647 100644 --- a/src/Jackett.Common/Indexers/ImmortalSeed.cs +++ b/src/Jackett.Common/Indexers/ImmortalSeed.cs @@ -23,8 +23,8 @@ namespace Jackett.Common.Indexers private string LoginUrl => SiteLink + "takelogin.php"; private string QueryString => "?do=search&keywords={0}&search_type=t_name&category=0&include_dead_torrents=no"; - public override string[] LegacySiteLinks { get; protected set; } = new string[] { - "http://immortalseed.me/", + public override string[] LegacySiteLinks { get; protected set; } = { + "http://immortalseed.me/" }; private new ConfigurationDataBasicLogin configData diff --git a/src/Jackett.Common/Indexers/InternetArchive.cs b/src/Jackett.Common/Indexers/InternetArchive.cs index 41dc43e47..ce5f2020e 100644 --- a/src/Jackett.Common/Indexers/InternetArchive.cs +++ b/src/Jackett.Common/Indexers/InternetArchive.cs @@ -79,12 +79,12 @@ namespace Jackett.Common.Indexers var order = new SelectItem(new Dictionary { {"desc", "desc"}, - {"asc", "asc"}, + {"asc", "asc"} }) { Name = "Order requested from site", Value = "desc" }; configData.AddDynamic("order", order); - var titleOnly = new BoolItem() { Name = "Search only in title", Value = true }; + var titleOnly = new BoolItem { Name = "Search only in title", Value = true }; configData.AddDynamic("titleOnly", titleOnly); AddCategoryMapping("audio", TorznabCatType.Audio); diff --git a/src/Jackett.Common/Indexers/Libble.cs b/src/Jackett.Common/Indexers/Libble.cs index 037c38c96..d0798e80d 100644 --- a/src/Jackett.Common/Indexers/Libble.cs +++ b/src/Jackett.Common/Indexers/Libble.cs @@ -27,7 +27,7 @@ namespace Jackett.Common.Indexers private Dictionary CategoryMappings = new Dictionary{ { "cats_music", "Music" }, { "cats_libblemixtapes", "Libble Mixtapes" }, - { "cats_musicvideos", "Music Videos" }, + { "cats_musicvideos", "Music Videos" } }; class VolumeFactorTag { @@ -46,7 +46,7 @@ namespace Jackett.Common.Indexers DownloadVolumeFactor = 0, UploadVolumeFactor = 1 } - }, + } }; private new ConfigurationDataBasicLogin configData @@ -171,7 +171,7 @@ namespace Jackett.Common.Indexers var albumRows = dom.QuerySelectorAll("table#torrent_table > tbody > tr:has(strong > a[href*=\"torrents.php?id=\"])"); foreach (var row in albumRows) { - Regex releaseGroupRegex = new Regex(@"torrents\.php\?id=([0-9]+)"); + var releaseGroupRegex = new Regex(@"torrents\.php\?id=([0-9]+)"); var albumNameNode = row.QuerySelector("strong > a[href*=\"torrents.php?id=\"]"); var artistsNameNodes = row.QuerySelectorAll("strong > a[href*=\"artist.php?id=\"]"); @@ -182,7 +182,7 @@ namespace Jackett.Common.Indexers var releaseArtist = "Various Artists"; if (artistsNameNodes.Count() > 0) { - List aristNames = new List(); + var aristNames = new List(); foreach (var aristNode in artistsNameNodes) { aristNames.Add(aristNode.TextContent.Trim()); @@ -269,11 +269,11 @@ namespace Jackett.Common.Indexers release.DownloadVolumeFactor = 1; release.UploadVolumeFactor = 1; var releaseTags = releaseMediaType.Split('/').Select(tag => tag.Trim()).ToList(); - for (int i = releaseTags.Count - 1; i >= 0; i--) + for (var i = releaseTags.Count - 1; i >= 0; i--) { - string releaseTag = releaseTags[i]; + var releaseTag = releaseTags[i]; if (VolumeTagMappings.ContainsKey(releaseTag)) { - VolumeFactorTag volumeFactor = VolumeTagMappings[releaseTag]; + var volumeFactor = VolumeTagMappings[releaseTag]; release.DownloadVolumeFactor = volumeFactor.DownloadVolumeFactor; release.UploadVolumeFactor = volumeFactor.UploadVolumeFactor; releaseTags.RemoveAt(i); diff --git a/src/Jackett.Common/Indexers/LostFilm.cs b/src/Jackett.Common/Indexers/LostFilm.cs index 564726179..57bba5abf 100644 --- a/src/Jackett.Common/Indexers/LostFilm.cs +++ b/src/Jackett.Common/Indexers/LostFilm.cs @@ -22,8 +22,8 @@ namespace Jackett.Common.Indexers [ExcludeFromCodeCoverage] internal class LostFilm : BaseWebIndexer { - public override string[] LegacySiteLinks { get; protected set; } = new string[] { - "https://www.lostfilm.tv/", + public override string[] LegacySiteLinks { get; protected set; } = { + "https://www.lostfilm.tv/" }; private static readonly Regex parsePlayEpisodeRegex = new Regex("PlayEpisode\\('(?\\d{1,3})(?\\d{3})(?\\d{3})'\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase); @@ -730,7 +730,7 @@ namespace Jackett.Common.Indexers // Ru title: downloadLink.TextContent.Replace("\n", ""); // En title should be manually constructed. - var titleComponents = new string[] { + var titleComponents = new[] { serieTitle, details.GetEpisodeString(), episodeName, techInfo }; var downloadLink = row.QuerySelector("div.inner-box--link > a"); diff --git a/src/Jackett.Common/Indexers/MejorTorrent.cs b/src/Jackett.Common/Indexers/MejorTorrent.cs index 31829f29a..b853b37f7 100644 --- a/src/Jackett.Common/Indexers/MejorTorrent.cs +++ b/src/Jackett.Common/Indexers/MejorTorrent.cs @@ -40,7 +40,7 @@ namespace Jackett.Common.Indexers "http://www.mejortorrent.tv/", "http://www.mejortorrentt.com/", "https://www.mejortorrentt.org/", - "http://www.mejortorrentt.org/", + "http://www.mejortorrentt.org/" }; public MejorTorrent(IIndexerConfigurationService configService, WebClient w, Logger l, IProtectionService ps) diff --git a/src/Jackett.Common/Indexers/Meta/ResultFilters.cs b/src/Jackett.Common/Indexers/Meta/ResultFilters.cs index 05ef1e4d5..eb3bc42af 100644 --- a/src/Jackett.Common/Indexers/Meta/ResultFilters.cs +++ b/src/Jackett.Common/Indexers/Meta/ResultFilters.cs @@ -74,7 +74,7 @@ namespace Jackett.Common.Indexers.Meta private static IEnumerable GenerateTitleVariants(string title) { - var delimiterVariants = new char[] { '.', '_' }; + var delimiterVariants = new[] { '.', '_' }; var result = new List(); var replacedTitles = delimiterVariants.Select(c => title.Replace(' ', c)); diff --git a/src/Jackett.Common/Indexers/Milkie.cs b/src/Jackett.Common/Indexers/Milkie.cs index e83e08a95..8d1023365 100644 --- a/src/Jackett.Common/Indexers/Milkie.cs +++ b/src/Jackett.Common/Indexers/Milkie.cs @@ -116,7 +116,7 @@ namespace Jackett.Common.Indexers var comments = new Uri($"{SiteLink}browse/{torrent.Id}"); var publishDate = DateTimeUtil.FromUnknown(torrent.CreatedAt); - var release = new ReleaseInfo() + var release = new ReleaseInfo { Title = torrent.ReleaseName, Link = link, diff --git a/src/Jackett.Common/Indexers/MoreThanTV.cs b/src/Jackett.Common/Indexers/MoreThanTV.cs index 68191b156..8339639ec 100644 --- a/src/Jackett.Common/Indexers/MoreThanTV.cs +++ b/src/Jackett.Common/Indexers/MoreThanTV.cs @@ -23,7 +23,7 @@ namespace Jackett.Common.Indexers public class MoreThanTV : BaseWebIndexer { public override string[] LegacySiteLinks { get; protected set; } = { - "https://www.morethan.tv/", + "https://www.morethan.tv/" }; private string LoginUrl => SiteLink + "login.php"; diff --git a/src/Jackett.Common/Indexers/NewPCT.cs b/src/Jackett.Common/Indexers/NewPCT.cs index 867dc4905..31bf68b64 100644 --- a/src/Jackett.Common/Indexers/NewPCT.cs +++ b/src/Jackett.Common/Indexers/NewPCT.cs @@ -23,7 +23,7 @@ namespace Jackett.Common.Indexers private enum ReleaseType { Tv, - Movie, + Movie } private class NewpctRelease : ReleaseInfo @@ -77,7 +77,7 @@ namespace Jackett.Common.Indexers { MatchRegex = new Regex(@"window\.location\.href\s*=\s*""([^""]+)"""), MatchEvaluator = m => $"https:{m.Groups[1]}" - }, + } }; private readonly int _maxDailyPages = 1; diff --git a/src/Jackett.Common/Indexers/NewRealWorld.cs b/src/Jackett.Common/Indexers/NewRealWorld.cs index 7d1a29676..3d9aaaab2 100644 --- a/src/Jackett.Common/Indexers/NewRealWorld.cs +++ b/src/Jackett.Common/Indexers/NewRealWorld.cs @@ -194,7 +194,7 @@ namespace Jackett.Common.Indexers var dlLink = qDownloadLink.GetAttribute("href"); if (dlLink.Contains("javascript")) // depending on the user agent the DL link is a javascript call { - var dlLinkParts = dlLink.Split(new char[] { '\'', ',' }); + var dlLinkParts = dlLink.Split(new[] { '\'', ',' }); dlLink = SiteLink + "download/" + dlLinkParts[3] + "/" + dlLinkParts[5]; } var link = new Uri(dlLink); diff --git a/src/Jackett.Common/Indexers/NorBits.cs b/src/Jackett.Common/Indexers/NorBits.cs index 4a0638afb..e199b1851 100644 --- a/src/Jackett.Common/Indexers/NorBits.cs +++ b/src/Jackett.Common/Indexers/NorBits.cs @@ -134,7 +134,7 @@ namespace Jackett.Common.Indexers private async Task DoLogin() { // Build WebRequest for index - var myIndexRequest = new WebRequest() + var myIndexRequest = new WebRequest { Type = RequestType.GET, Url = SiteLink, @@ -153,7 +153,7 @@ namespace Jackett.Common.Indexers }; // Build WebRequest for login - var myRequestLogin = new WebRequest() + var myRequestLogin = new WebRequest { Type = RequestType.GET, Url = LoginUrl, @@ -169,7 +169,7 @@ namespace Jackett.Common.Indexers await webclient.GetResultAsync(myRequestLogin); // Build WebRequest for submitting authentification - var request = new WebRequest() + var request = new WebRequest { PostData = pairs, Referer = LoginUrl, diff --git a/src/Jackett.Common/Indexers/PassThePopcorn.cs b/src/Jackett.Common/Indexers/PassThePopcorn.cs index 9aff2dec2..cc3161300 100644 --- a/src/Jackett.Common/Indexers/PassThePopcorn.cs +++ b/src/Jackett.Common/Indexers/PassThePopcorn.cs @@ -117,7 +117,7 @@ namespace Jackett.Common.Indexers movieListSearchUrl += "?" + queryCollection.GetQueryString(); - var authHeaders = new Dictionary() + var authHeaders = new Dictionary { { "ApiUser", configData.User.Value }, { "ApiKey", configData.Key.Value } @@ -153,7 +153,7 @@ namespace Jackett.Common.Indexers {"action", "download"}, {"id", torrentId}, {"authkey", AuthKey}, - {"torrent_pass", PassKey}, + {"torrent_pass", PassKey} }; var free = !(torrent["FreeleechType"] is null); diff --git a/src/Jackett.Common/Indexers/PolishTracker.cs b/src/Jackett.Common/Indexers/PolishTracker.cs index e5bf030b2..da30581a7 100644 --- a/src/Jackett.Common/Indexers/PolishTracker.cs +++ b/src/Jackett.Common/Indexers/PolishTracker.cs @@ -22,7 +22,7 @@ namespace Jackett.Common.Indexers private static string CdnUrl => "https://cdn.pte.nu/"; public override string[] LegacySiteLinks { get; protected set; } = { - "https://polishtracker.net/", + "https://polishtracker.net/" }; private new ConfigurationDataCookie configData => (ConfigurationDataCookie)base.configData; diff --git a/src/Jackett.Common/Indexers/ShizaProject.cs b/src/Jackett.Common/Indexers/ShizaProject.cs index 2d9707da0..c07ce3226 100644 --- a/src/Jackett.Common/Indexers/ShizaProject.cs +++ b/src/Jackett.Common/Indexers/ShizaProject.cs @@ -101,7 +101,7 @@ namespace Jackett.Common.Indexers // Prepare the search query var queryParameters = new NameValueCollection { - { "q", query.SearchTerm}, + { "q", query.SearchTerm} }; result = await RequestWithCookiesAndRetryAsync(SearchUrl + "?" + queryParameters.GetQueryString()); } @@ -151,13 +151,14 @@ namespace Jackett.Common.Indexers var document = await parser.ParseDocumentAsync(result.ContentString); var r = document.QuerySelector("div.release > div.wrapper-release"); - var baseRelease = new ReleaseInfo(){ + var baseRelease = new ReleaseInfo + { Title = composeBaseTitle(r), BannerUrl = new Uri(SiteLink + r.QuerySelector("a[data-fancybox]").Attributes["href"].Value), Comments = uri, DownloadVolumeFactor = 0, UploadVolumeFactor = 1, - Category = new int[]{ TorznabCatType.TVAnime.ID }, + Category = new[]{ TorznabCatType.TVAnime.ID } }; foreach (var t in r.QuerySelectorAll("a[data-toggle]")) diff --git a/src/Jackett.Common/Indexers/ShowRSS.cs b/src/Jackett.Common/Indexers/ShowRSS.cs index d96e8c584..35f01b52d 100644 --- a/src/Jackett.Common/Indexers/ShowRSS.cs +++ b/src/Jackett.Common/Indexers/ShowRSS.cs @@ -104,7 +104,7 @@ namespace Jackett.Common.Indexers Seeders = 1, Peers = 2, DownloadVolumeFactor = 0, - UploadVolumeFactor = 1, + UploadVolumeFactor = 1 }; releases.Add(release); } diff --git a/src/Jackett.Common/Indexers/SolidTorrents.cs b/src/Jackett.Common/Indexers/SolidTorrents.cs index 56e4a9529..97be9394c 100644 --- a/src/Jackett.Common/Indexers/SolidTorrents.cs +++ b/src/Jackett.Common/Indexers/SolidTorrents.cs @@ -21,9 +21,9 @@ namespace Jackett.Common.Indexers { private string SearchUrl => SiteLink + "api/v1/search"; - private readonly Dictionary APIHeaders = new Dictionary() + private readonly Dictionary APIHeaders = new Dictionary { - {"Accept", "application/json, text/plain, */*"}, + {"Accept", "application/json, text/plain, */*"} }; private readonly int MAX_RESULTS_PER_PAGE = 20; diff --git a/src/Jackett.Common/Indexers/SuperBits.cs b/src/Jackett.Common/Indexers/SuperBits.cs index 37c74da89..ed4b67301 100644 --- a/src/Jackett.Common/Indexers/SuperBits.cs +++ b/src/Jackett.Common/Indexers/SuperBits.cs @@ -141,7 +141,7 @@ namespace Jackett.Common.Indexers try { //var json = JArray.Parse(results.Content); - dynamic json = JsonConvert.DeserializeObject(results.ContentString); + var json = JsonConvert.DeserializeObject(results.ContentString); foreach (var row in json ?? Enumerable.Empty()) { var release = new ReleaseInfo(); diff --git a/src/Jackett.Common/Indexers/TVStore.cs b/src/Jackett.Common/Indexers/TVStore.cs index cdb803690..095852494 100644 --- a/src/Jackett.Common/Indexers/TVStore.cs +++ b/src/Jackett.Common/Indexers/TVStore.cs @@ -45,7 +45,7 @@ namespace Jackett.Common.Indexers MovieSearchParams = new List { MovieSearchParam.Q, MovieSearchParam.ImdbId - }, + } }, configService: configService, client: wc, diff --git a/src/Jackett.Common/Indexers/ThePirateBay.cs b/src/Jackett.Common/Indexers/ThePirateBay.cs index 3284f4a64..86bf11f33 100644 --- a/src/Jackett.Common/Indexers/ThePirateBay.cs +++ b/src/Jackett.Common/Indexers/ThePirateBay.cs @@ -32,7 +32,7 @@ namespace Jackett.Common.Indexers "https://tpb.skynetcloud.site/", "https://piratetoday.xyz/", "https://piratenow.xyz/", - "https://piratesbaycc.com/", + "https://piratesbaycc.com/" }; public override string[] LegacySiteLinks { get; protected set; } = { @@ -50,7 +50,7 @@ namespace Jackett.Common.Indexers "https://piratebayztemzmv.onion.pet/", "https://piratebayztemzmv.onion.ly/", "https://pirateproxy.cloud/", - "https://tpb18.ukpass.co/", + "https://tpb18.ukpass.co/" }; private const string KeyInfoHash = "{info_hash}"; diff --git a/src/Jackett.Common/Indexers/TorrentLeech.cs b/src/Jackett.Common/Indexers/TorrentLeech.cs index 29e4092ed..6bb698a10 100644 --- a/src/Jackett.Common/Indexers/TorrentLeech.cs +++ b/src/Jackett.Common/Indexers/TorrentLeech.cs @@ -27,7 +27,7 @@ namespace Jackett.Common.Indexers public override string[] LegacySiteLinks { get; protected set; } = { - "https://v4.torrentleech.org/", + "https://v4.torrentleech.org/" }; public TorrentLeech(IIndexerConfigurationService configService, Utils.Clients.WebClient wc, Logger l, IProtectionService ps) diff --git a/src/Jackett.Common/Indexers/TorrentNetwork.cs b/src/Jackett.Common/Indexers/TorrentNetwork.cs index a6d210db4..0355d1217 100644 --- a/src/Jackett.Common/Indexers/TorrentNetwork.cs +++ b/src/Jackett.Common/Indexers/TorrentNetwork.cs @@ -22,9 +22,9 @@ namespace Jackett.Common.Indexers private string APIUrl => SiteLink + "api/"; private string passkey; - private readonly Dictionary APIHeaders = new Dictionary() + private readonly Dictionary APIHeaders = new Dictionary { - {"Content-Type", "application/json"}, + {"Content-Type", "application/json"} }; private new ConfigurationDataBasicLoginWithRSSAndDisplay configData @@ -59,8 +59,8 @@ namespace Jackett.Common.Indexers Language = "de-de"; Type = "private"; - configData.AddDynamic("token", new HiddenItem() { Name = "token" }); - configData.AddDynamic("passkey", new HiddenItem() { Name = "passkey" }); + configData.AddDynamic("token", new HiddenItem { Name = "token" }); + configData.AddDynamic("passkey", new HiddenItem { Name = "passkey" }); AddCategoryMapping(24, TorznabCatType.MoviesSD, "Movies GER/SD"); AddCategoryMapping(18, TorznabCatType.MoviesHD, "Movies GER/720p"); @@ -138,7 +138,7 @@ namespace Jackett.Common.Indexers APIUrl + endpoint, method: RequestType.POST, referer: SiteLink, headers: APIHeaders, rawbody: jsonData); if (!result.ContentString.StartsWith("{")) // not JSON => error throw new ExceptionWithConfigData(result.ContentString, configData); - dynamic json = JsonConvert.DeserializeObject(result.ContentString); + var json = JsonConvert.DeserializeObject(result.ContentString); return json; } @@ -233,7 +233,7 @@ namespace Jackett.Common.Indexers // 50 % Down 1 => 0.5, // All others 100% down - _ => 1, + _ => 1 }; var release = new ReleaseInfo { diff --git a/src/Jackett.Common/Indexers/TorrentsCSV.cs b/src/Jackett.Common/Indexers/TorrentsCSV.cs index dd8f06c5c..b82b295d6 100644 --- a/src/Jackett.Common/Indexers/TorrentsCSV.cs +++ b/src/Jackett.Common/Indexers/TorrentsCSV.cs @@ -81,7 +81,7 @@ namespace Jackett.Common.Indexers Seeders = 0, Peers = 0, DownloadVolumeFactor = 0, - UploadVolumeFactor = 1, + UploadVolumeFactor = 1 }); return releases; } @@ -171,7 +171,7 @@ namespace Jackett.Common.Indexers Seeders = seeders, Peers = leechers + seeders, DownloadVolumeFactor = 0, - UploadVolumeFactor = 1, + UploadVolumeFactor = 1 }; releases.Add(release); diff --git a/src/Jackett.Common/Indexers/Xthor.cs b/src/Jackett.Common/Indexers/Xthor.cs index 9fd1f16a2..3f4d9e872 100644 --- a/src/Jackett.Common/Indexers/Xthor.cs +++ b/src/Jackett.Common/Indexers/Xthor.cs @@ -26,9 +26,9 @@ namespace Jackett.Common.Indexers { private static string ApiEndpoint => "https://api.xthor.tk/"; - public override string[] LegacySiteLinks { get; protected set; } = new string[] { + public override string[] LegacySiteLinks { get; protected set; } = { "https://xthor.bz/", - "https://xthor.to", + "https://xthor.to" }; private string TorrentCommentUrl => TorrentDescriptionUrl; @@ -490,7 +490,7 @@ namespace Jackett.Common.Indexers Output("\nQuerying tracker for results...."); // Build WebRequest for index - var myIndexRequest = new WebRequest() + var myIndexRequest = new WebRequest { Type = RequestType.GET, Url = request, diff --git a/src/Jackett.Common/Indexers/YTS.cs b/src/Jackett.Common/Indexers/YTS.cs index e3f27caad..64a5faaa7 100644 --- a/src/Jackett.Common/Indexers/YTS.cs +++ b/src/Jackett.Common/Indexers/YTS.cs @@ -19,10 +19,10 @@ namespace Jackett.Common.Indexers [ExcludeFromCodeCoverage] public class YTS : BaseWebIndexer { - public override string[] LegacySiteLinks { get; protected set; } = new string[] { + public override string[] LegacySiteLinks { get; protected set; } = { "https://yts.ag/", "https://yts.am/", - "https://yts.lt/", + "https://yts.lt/" }; private string ApiEndpoint => SiteLink + "api/v2/list_movies.json";