From c12da520a403f68e29a7409900d681f79570d33b Mon Sep 17 00:00:00 2001 From: Cory Date: Sat, 8 Feb 2020 20:35:16 -0600 Subject: [PATCH] Run dotnet format on solution (#7145) --- src/DateTimeRoutines/DateTimeRoutines.cs | 22 +- src/Jackett.Common/ExceptionWithConfigData.cs | 2 +- .../Helpers/CookieContainerExtensions.cs | 2 +- .../Helpers/HttpClientExtensions.cs | 2 +- .../Helpers/WebUtilityHelpers.cs | 2 +- src/Jackett.Common/IndexerException.cs | 2 +- src/Jackett.Common/Indexers/720pier.cs | 2 +- src/Jackett.Common/Indexers/Abnormal.cs | 9 +- .../Indexers/Abstract/AvistazTracker.cs | 10 +- .../Indexers/Abstract/CouchPotatoTracker.cs | 4 +- .../Indexers/Abstract/GazelleTracker.cs | 9 +- src/Jackett.Common/Indexers/AlphaRatio.cs | 2 +- src/Jackett.Common/Indexers/AniDub.cs | 20 +- src/Jackett.Common/Indexers/AnimeBytes.cs | 11 +- src/Jackett.Common/Indexers/AnimeTorrents.cs | 2 +- src/Jackett.Common/Indexers/Anthelion.cs | 4 +- src/Jackett.Common/Indexers/Avistaz.cs | 4 +- src/Jackett.Common/Indexers/BB.cs | 2 +- src/Jackett.Common/Indexers/BJShare.cs | 34 +- src/Jackett.Common/Indexers/BakaBT.cs | 4 +- src/Jackett.Common/Indexers/BaseIndexer.cs | 5 +- .../Indexers/BitCityReloaded.cs | 25 +- src/Jackett.Common/Indexers/BitHdtv.cs | 2 +- src/Jackett.Common/Indexers/BrokenStones.cs | 2 +- .../Indexers/CardigannIndexer.cs | 7 +- src/Jackett.Common/Indexers/CinemaZ.cs | 4 +- src/Jackett.Common/Indexers/Corsarored.cs | 411 +++++++++--------- src/Jackett.Common/Indexers/DigitalHive.cs | 4 +- src/Jackett.Common/Indexers/DivxTotal.cs | 29 +- src/Jackett.Common/Indexers/EliteTracker.cs | 2 +- .../Indexers/Feeds/AnimeTosho.cs | 2 +- .../Indexers/Feeds/BaseFeedIndexer.cs | 2 +- .../Indexers/Feeds/BaseNewznabIndexer.cs | 2 +- src/Jackett.Common/Indexers/FileList.cs | 4 +- src/Jackett.Common/Indexers/FunFile.cs | 8 +- src/Jackett.Common/Indexers/Fuzer.cs | 5 +- src/Jackett.Common/Indexers/GazelleGames.cs | 8 +- src/Jackett.Common/Indexers/GimmePeers.cs | 2 +- src/Jackett.Common/Indexers/HDBitsApi.cs | 6 +- src/Jackett.Common/Indexers/HDOlimpo.cs | 6 +- src/Jackett.Common/Indexers/HDOnly.cs | 2 +- src/Jackett.Common/Indexers/HDSpace.cs | 5 +- src/Jackett.Common/Indexers/HDTorrents.cs | 10 +- src/Jackett.Common/Indexers/Hebits.cs | 2 +- src/Jackett.Common/Indexers/HorribleSubs.cs | 7 +- src/Jackett.Common/Indexers/IIndexer.cs | 2 +- src/Jackett.Common/Indexers/IPTorrents.cs | 16 +- src/Jackett.Common/Indexers/ImmortalSeed.cs | 2 +- .../Indexers/InternetArchive.cs | 14 +- src/Jackett.Common/Indexers/LostFilm.cs | 2 +- src/Jackett.Common/Indexers/MejorTorrent.cs | 35 +- .../Indexers/Meta/BaseMetaIndexer.cs | 2 +- src/Jackett.Common/Indexers/Meta/Fallbacks.cs | 2 +- .../Indexers/Meta/MetaIndexers.cs | 4 +- .../Indexers/Meta/ResultFilters.cs | 19 +- src/Jackett.Common/Indexers/MoreThanTV.cs | 11 +- src/Jackett.Common/Indexers/MyAnonamouse.cs | 10 +- src/Jackett.Common/Indexers/NCore.cs | 31 +- src/Jackett.Common/Indexers/NewRealWorld.cs | 20 +- src/Jackett.Common/Indexers/Newpct.cs | 2 +- src/Jackett.Common/Indexers/Norbits.cs | 2 +- src/Jackett.Common/Indexers/Nordicbits.cs | 6 +- src/Jackett.Common/Indexers/Orpheus.cs | 2 +- src/Jackett.Common/Indexers/PassThePopcorn.cs | 4 +- src/Jackett.Common/Indexers/PiXELHD.cs | 2 +- src/Jackett.Common/Indexers/PirateTheNet.cs | 2 +- src/Jackett.Common/Indexers/PolishTracker.cs | 4 +- src/Jackett.Common/Indexers/Pretome.cs | 2 +- src/Jackett.Common/Indexers/PrivateHD.cs | 2 +- src/Jackett.Common/Indexers/Psytorrents.cs | 2 +- src/Jackett.Common/Indexers/Rarbg.cs | 7 +- src/Jackett.Common/Indexers/Redacted.cs | 4 +- src/Jackett.Common/Indexers/SceneHD.cs | 8 +- src/Jackett.Common/Indexers/SceneTime.cs | 2 +- src/Jackett.Common/Indexers/SecretCinema.cs | 4 +- src/Jackett.Common/Indexers/Shazbat.cs | 2 +- src/Jackett.Common/Indexers/ShowRSS.cs | 4 +- src/Jackett.Common/Indexers/SpeedCD.cs | 2 +- src/Jackett.Common/Indexers/Superbits.cs | 2 +- src/Jackett.Common/Indexers/TVVault.cs | 2 +- src/Jackett.Common/Indexers/TVstore.cs | 21 +- src/Jackett.Common/Indexers/TorrentBytes.cs | 2 +- src/Jackett.Common/Indexers/TorrentDay.cs | 10 +- src/Jackett.Common/Indexers/TorrentHeaven.cs | 8 +- src/Jackett.Common/Indexers/TorrentLeech.cs | 2 +- src/Jackett.Common/Indexers/TorrentNetwork.cs | 2 +- .../Indexers/TorrentSyndikat.cs | 12 +- src/Jackett.Common/Indexers/Torrentech.cs | 2 +- src/Jackett.Common/Indexers/Torrentscsv.cs | 168 ++++--- src/Jackett.Common/Indexers/TransmitheNet.cs | 2 +- src/Jackett.Common/Indexers/XSpeeds.cs | 2 +- src/Jackett.Common/Indexers/Xthor.cs | 116 ++--- src/Jackett.Common/Indexers/cgpeers.cs | 2 +- src/Jackett.Common/Indexers/digitalcore.cs | 4 +- src/Jackett.Common/Indexers/myAmity.cs | 12 +- src/Jackett.Common/Indexers/notwhatcd.cs | 4 +- src/Jackett.Common/Indexers/pornolab.cs | 4 +- src/Jackett.Common/Indexers/rutracker.cs | 8 +- src/Jackett.Common/Indexers/toloka.cs | 20 +- src/Jackett.Common/Indexers/yts.cs | 6 +- .../JackettProtectedAttribute.cs | 2 +- src/Jackett.Common/Models/CachedLog.cs | 2 +- .../Models/CachedQueryResult.cs | 5 +- src/Jackett.Common/Models/CachedResult.cs | 2 +- src/Jackett.Common/Models/CategoryMapping.cs | 2 +- src/Jackett.Common/Models/ChannelInfo.cs | 2 +- .../Models/Config/ConsoleOptions.cs | 4 +- src/Jackett.Common/Models/Config/ProxyType.cs | 2 +- .../Models/Config/RuntimeSettings.cs | 4 +- .../Models/Config/ServerConfig.cs | 2 +- src/Jackett.Common/Models/DTO/ApiSearch.cs | 2 +- src/Jackett.Common/Models/DTO/Config.cs | 2 +- src/Jackett.Common/Models/DTO/Indexer.cs | 12 +- .../Models/DTO/ManualSearchResult.cs | 2 +- src/Jackett.Common/Models/DTO/ServerConfig.cs | 2 +- .../Models/DTO/TorrentPotatoRequest.cs | 2 +- .../Models/DTO/TorrentPotatoResponse.cs | 2 +- .../Models/DTO/TorrentPotatoResponseItem.cs | 2 +- .../Models/DTO/TorznabRequest.cs | 2 +- src/Jackett.Common/Models/GitHub/Asset.cs | 2 +- src/Jackett.Common/Models/GitHub/Release.cs | 2 +- .../Bespoke/ConfigurationDataAbnormal.cs | 6 +- .../Bespoke/ConfigurationDataAniDub.cs | 2 +- .../Bespoke/ConfigurationDataAnimeBytes.cs | 2 +- .../Bespoke/ConfigurationDataEliteTracker.cs | 2 +- .../Bespoke/ConfigurationDataFileList.cs | 2 +- .../Bespoke/ConfigurationDataMyAnonamouse.cs | 2 +- .../Bespoke/ConfigurationDataNCore.cs | 4 +- .../Bespoke/ConfigurationDataNorbits.cs | 4 +- .../Bespoke/ConfigurationDataRutracker.cs | 2 +- .../Bespoke/ConfigurationDataSceneTime.cs | 2 +- .../Bespoke/ConfigurationDataTVstore.cs | 4 +- .../Bespoke/ConfigurationDataToloka.cs | 2 +- .../Bespoke/ConfigurationDataXthor.cs | 4 +- .../Models/IndexerConfig/ConfigurationData.cs | 6 +- .../IndexerConfig/ConfigurationDataAPIKey.cs | 2 +- ...DataAPILoginWithUserAndPasskeyAndFilter.cs | 2 +- .../ConfigurationDataBasicLogin.cs | 2 +- .../ConfigurationDataBasicLoginWithEmail.cs | 2 +- .../ConfigurationDataBasicLoginWithFilter.cs | 4 +- ...ationDataBasicLoginWithFilterAndPasskey.cs | 4 +- .../ConfigurationDataBasicLoginWithRSS.cs | 2 +- ...gurationDataBasicLoginWithRSSAndDisplay.cs | 4 +- .../ConfigurationDataCaptchaLogin.cs | 2 +- .../IndexerConfig/ConfigurationDataCookie.cs | 2 +- .../ConfigurationDataLoginLink.cs | 4 +- .../ConfigurationDataLoginTokin.cs | 2 +- .../ConfigurationDataPinNumber.cs | 2 +- .../ConfigurationDataRecaptchaLogin.cs | 2 +- .../IndexerConfig/ConfigurationDataUrl.cs | 2 +- .../IndexerConfig/ISerializableConfig.cs | 2 +- .../Models/IndexerConfigurationStatus.cs | 2 +- .../Models/IndexerDefinition.cs | 2 +- src/Jackett.Common/Models/ReleaseInfo.cs | 2 +- src/Jackett.Common/Models/ResultPage.cs | 2 +- .../Models/TorznabCapabilities.cs | 2 +- src/Jackett.Common/Models/TorznabCatType.cs | 2 +- src/Jackett.Common/Models/TorznabCategory.cs | 2 +- src/Jackett.Common/Models/TorznabQuery.cs | 2 +- src/Jackett.Common/Models/TrackerCache.cs | 2 +- .../Models/TrackerCacheResult.cs | 2 +- src/Jackett.Common/Plumbing/JackettModule.cs | 40 +- src/Jackett.Common/Services/CacheService.cs | 15 +- .../Services/ConfigurationService.cs | 11 +- src/Jackett.Common/Services/ImdbResolver.cs | 2 +- .../Services/IndexerConfigurationService.cs | 2 +- .../Services/IndexerManagerService.cs | 5 +- .../Services/Interfaces/ICacheService.cs | 2 +- .../Interfaces/IConfigurationService.cs | 2 +- .../Interfaces/IFilePermissionService.cs | 2 +- .../Services/Interfaces/IImdbResolver.cs | 2 +- .../IIndexerConfigurationService.cs | 2 +- .../Interfaces/IIndexerManagerService.cs | 2 +- .../Services/Interfaces/ILogCacheService.cs | 4 +- .../Services/Interfaces/IProcessService.cs | 2 +- .../Services/Interfaces/IProtectionService.cs | 2 +- .../Services/Interfaces/IRunTimeService.cs | 2 +- .../Services/Interfaces/ISecuityService.cs | 2 +- .../Services/Interfaces/ISerializeService.cs | 2 +- .../Services/Interfaces/IServerService.cs | 2 +- .../Interfaces/IServiceConfigService.cs | 2 +- .../Services/Interfaces/ITrayLockService.cs | 2 +- .../Services/Interfaces/IUpdateService.cs | 2 +- .../Services/LogCacheService.cs | 6 +- src/Jackett.Common/Services/ProcessService.cs | 8 +- .../Services/SerializeService.cs | 4 +- src/Jackett.Common/Services/SpinService.cs | 2 +- .../Services/TrayLockService.cs | 4 +- src/Jackett.Common/Services/UpdateService.cs | 16 +- .../Services/WindowsServiceConfigService.cs | 2 +- src/Jackett.Common/Utils/BrowserUtil.cs | 5 +- src/Jackett.Common/Utils/BuildDate.cs | 2 +- .../Utils/Clients/BaseWebResult.cs | 14 +- .../Utils/Clients/HttpWebClient.cs | 2 +- .../Utils/Clients/HttpWebClient2.cs | 2 +- .../Utils/Clients/HttpWebClient2NetCore.cs | 2 +- .../Utils/Clients/HttpWebClientNetCore.cs | 2 +- .../Utils/Clients/WebByteResult.cs | 2 +- src/Jackett.Common/Utils/Clients/WebClient.cs | 2 +- .../Utils/Clients/WebClientResult.cs | 4 +- .../Utils/Clients/WebRequest.cs | 2 +- src/Jackett.Common/Utils/DataUrl.cs | 2 +- src/Jackett.Common/Utils/DateTimeUtil.cs | 29 +- src/Jackett.Common/Utils/DotNetCoreUtil.cs | 2 +- src/Jackett.Common/Utils/EnvironmentUtil.cs | 4 +- src/Jackett.Common/Utils/Extensions.cs | 2 +- src/Jackett.Common/Utils/JsonContent.cs | 2 +- src/Jackett.Common/Utils/JsonUtil.cs | 2 +- src/Jackett.Common/Utils/LoggingSetup.cs | 2 +- src/Jackett.Common/Utils/ParseUtil.cs | 7 +- src/Jackett.Common/Utils/ServerUtil.cs | 2 +- src/Jackett.Common/Utils/StringCipher.cs | 2 +- src/Jackett.Common/Utils/StringUtil.cs | 11 +- src/Jackett.Common/Utils/TorznabCapsUtil.cs | 2 +- src/Jackett.Common/Utils/TvCategoryParser.cs | 2 +- src/Jackett.Common/Utils/Variants.cs | 50 +-- .../WebDriverFactory.cs | 3 +- .../ActionFilters/DownloadActionFilter.cs | 2 +- .../Controllers/UIController.cs | 3 +- .../Middleware/RedirectRules.cs | 2 +- .../Services/ProtectionService.cs | 2 +- .../Services/ServiceConfigService.cs | 2 +- .../Services/ProtectionServiceTests.cs | 2 +- src/Jackett.Test/TestUtil.cs | 6 +- src/Jackett.Test/TestWebClient.cs | 4 +- src/Jackett.Test/Util/ParseUtilTests.cs | 4 +- src/Jackett.Test/WebUtilityHelpersTests.cs | 2 +- src/Jackett.Updater/Program.cs | 6 +- 228 files changed, 978 insertions(+), 889 deletions(-) diff --git a/src/DateTimeRoutines/DateTimeRoutines.cs b/src/DateTimeRoutines/DateTimeRoutines.cs index 1ab43ee92..8dbfc2ab2 100644 --- a/src/DateTimeRoutines/DateTimeRoutines.cs +++ b/src/DateTimeRoutines/DateTimeRoutines.cs @@ -351,7 +351,7 @@ namespace DateTimeRoutines parsed_time = null; string time_zone_r; - if(default_format == DateTimeFormat.USA_DATE) + if (default_format == DateTimeFormat.USA_DATE) time_zone_r = @"(?:\s*(?'time_zone'UTC|GMT|CST|EST))?"; else time_zone_r = @"(?:\s*(?'time_zone'UTC|GMT))?"; @@ -363,13 +363,13 @@ namespace DateTimeRoutines m = Regex.Match(str.Substring(parsed_date.IndexOfDate + parsed_date.LengthOfDate), @"(?<=^\s*,?\s+|^\s*at\s*|^\s*[T\-]\s*)(?'hour'\d{2})\s*:\s*(?'minute'\d{2})\s*:\s*(?'second'\d{2})\s+(?'offset_sign'[\+\-])(?'offset_hh'\d{2}):?(?'offset_mm'\d{2})(?=$|[^\d\w])", RegexOptions.Compiled); if (!m.Success) //look for [h]h:mm[:ss] [PM/AM] [UTC/GMT] - m = Regex.Match(str.Substring(parsed_date.IndexOfDate + parsed_date.LengthOfDate), @"(?<=^\s*,?\s+|^\s*at\s*|^\s*[T\-]\s*)(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?"+time_zone_r+@"(?=$|[^\d\w])", RegexOptions.Compiled); + m = Regex.Match(str.Substring(parsed_date.IndexOfDate + parsed_date.LengthOfDate), @"(?<=^\s*,?\s+|^\s*at\s*|^\s*[T\-]\s*)(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?" + time_zone_r + @"(?=$|[^\d\w])", RegexOptions.Compiled); if (!m.Success) //look for [h]h:mm:ss [PM/AM] [UTC/GMT] - m = Regex.Match(str.Substring(0, parsed_date.IndexOfDate), @"(?<=^|[^\d])(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?"+time_zone_r+@"(?=$|[\s,]+)", RegexOptions.Compiled); + m = Regex.Match(str.Substring(0, parsed_date.IndexOfDate), @"(?<=^|[^\d])(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?" + time_zone_r + @"(?=$|[\s,]+)", RegexOptions.Compiled); if (!m.Success) //look for [h]h:mm:ss [PM/AM] [UTC/GMT] within - m = Regex.Match(str.Substring(parsed_date.IndexOfDate, parsed_date.LengthOfDate), @"(?<=^|[^\d])(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?"+time_zone_r+@"(?=$|[\s,]+)", RegexOptions.Compiled); + m = Regex.Match(str.Substring(parsed_date.IndexOfDate, parsed_date.LengthOfDate), @"(?<=^|[^\d])(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?" + time_zone_r + @"(?=$|[\s,]+)", RegexOptions.Compiled); } else//look anywhere within string { @@ -377,7 +377,7 @@ namespace DateTimeRoutines m = Regex.Match(str, @"(?<=^|\s+|\s*T\s*)(?'hour'\d{2})\s*:\s*(?'minute'\d{2})\s*:\s*(?'second'\d{2})\s+(?'offset_sign'[\+\-])(?'offset_hh'\d{2}):?(?'offset_mm'\d{2})?(?=$|[^\d\w])", RegexOptions.Compiled); if (!m.Success) //look for [h]h:mm[:ss] [PM/AM] [UTC/GMT] - m = Regex.Match(str, @"(?<=^|\s+|\s*T\s*)(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?"+time_zone_r+@"(?=$|[^\d\w])", RegexOptions.Compiled); + m = Regex.Match(str, @"(?<=^|\s+|\s*T\s*)(?'hour'\d{1,2})\s*:\s*(?'minute'\d{2})\s*(?::\s*(?'second'\d{2}))?(?:\s*(?'ampm'AM|am|PM|pm))?" + time_zone_r + @"(?=$|[^\d\w])", RegexOptions.Compiled); } if (!m.Success) @@ -407,7 +407,7 @@ namespace DateTimeRoutines hour -= 12; DateTime date_time = new DateTime(1, 1, 1, hour, minute, second); - + if (m.Groups["offset_hh"].Success) { int offset_hh = int.Parse(m.Groups["offset_hh"].Value); @@ -428,7 +428,7 @@ namespace DateTimeRoutines { case "UTC": case "GMT": - utc_offset = new TimeSpan(0, 0, 0); + utc_offset = new TimeSpan(0, 0, 0); break; case "CST": utc_offset = new TimeSpan(-6, 0, 0); @@ -597,9 +597,9 @@ namespace DateTimeRoutines } else if (year > 30) - year += 1900; - else - year += 2000; + year += 1900; + else + year += 2000; try { @@ -615,4 +615,4 @@ namespace DateTimeRoutines #endregion } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/ExceptionWithConfigData.cs b/src/Jackett.Common/ExceptionWithConfigData.cs index 6c985f685..8ae81f64a 100644 --- a/src/Jackett.Common/ExceptionWithConfigData.cs +++ b/src/Jackett.Common/ExceptionWithConfigData.cs @@ -1,4 +1,4 @@ -using System; +using System; using Jackett.Common.Models.IndexerConfig; namespace Jackett.Common diff --git a/src/Jackett.Common/Helpers/CookieContainerExtensions.cs b/src/Jackett.Common/Helpers/CookieContainerExtensions.cs index baf4af270..7b1fe7747 100644 --- a/src/Jackett.Common/Helpers/CookieContainerExtensions.cs +++ b/src/Jackett.Common/Helpers/CookieContainerExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net; using Newtonsoft.Json.Linq; using NLog; diff --git a/src/Jackett.Common/Helpers/HttpClientExtensions.cs b/src/Jackett.Common/Helpers/HttpClientExtensions.cs index 5303bbc92..344d91069 100644 --- a/src/Jackett.Common/Helpers/HttpClientExtensions.cs +++ b/src/Jackett.Common/Helpers/HttpClientExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Threading.Tasks; diff --git a/src/Jackett.Common/Helpers/WebUtilityHelpers.cs b/src/Jackett.Common/Helpers/WebUtilityHelpers.cs index 24ca057ff..2fceb3dd8 100644 --- a/src/Jackett.Common/Helpers/WebUtilityHelpers.cs +++ b/src/Jackett.Common/Helpers/WebUtilityHelpers.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; using System.Text; namespace Jackett.Common.Helpers diff --git a/src/Jackett.Common/IndexerException.cs b/src/Jackett.Common/IndexerException.cs index 3140e54f8..c331d2f40 100644 --- a/src/Jackett.Common/IndexerException.cs +++ b/src/Jackett.Common/IndexerException.cs @@ -1,4 +1,4 @@ -using System; +using System; using Jackett.Common.Indexers; namespace Jackett.Common diff --git a/src/Jackett.Common/Indexers/720pier.cs b/src/Jackett.Common/Indexers/720pier.cs index fa3681271..e06525237 100644 --- a/src/Jackett.Common/Indexers/720pier.cs +++ b/src/Jackett.Common/Indexers/720pier.cs @@ -1,4 +1,4 @@ -using AngleSharp.Html.Parser; +using AngleSharp.Html.Parser; using Jackett.Common.Models; using Jackett.Common.Models.IndexerConfig; using Jackett.Common.Services.Interfaces; diff --git a/src/Jackett.Common/Indexers/Abnormal.cs b/src/Jackett.Common/Indexers/Abnormal.cs index b93b564ae..50066d3b8 100644 --- a/src/Jackett.Common/Indexers/Abnormal.cs +++ b/src/Jackett.Common/Indexers/Abnormal.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -304,9 +304,10 @@ namespace Jackett.Common.Indexers // Release Name string name = tRow.Find("td:eq(1) > a").Text(); //issue #3847 replace multi keyword - if(!string.IsNullOrEmpty(ReplaceMulti)){ + if (!string.IsNullOrEmpty(ReplaceMulti)) + { System.Text.RegularExpressions.Regex regex = new Regex("(?i)([\\.\\- ])MULTI([\\.\\- ])"); - name = regex.Replace(name, "$1"+ReplaceMulti+"$2"); + name = regex.Replace(name, "$1" + ReplaceMulti + "$2"); } output("Release: " + name); @@ -833,4 +834,4 @@ namespace Jackett.Common.Indexers } } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs b/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs index 2d9bcff8b..1d45bf79b 100644 --- a/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -112,12 +112,14 @@ namespace Jackett.Common.Indexers.Abstract release.MinimumRatio = 1; release.MinimumSeedTime = 172800; // 48 hours - var qLink = qRow.Find("a.torrent-filename"); ; + var qLink = qRow.Find("a.torrent-filename"); + ; release.Title = qLink.Text().Trim(); release.Comments = new Uri(qLink.Attr("href")); release.Guid = release.Comments; - var qDownload = qRow.Find("a.torrent-download-icon"); ; + var qDownload = qRow.Find("a.torrent-download-icon"); + ; release.Link = new Uri(qDownload.Attr("href")); var dateStr = qRow.Find("td:eq(3) > span").Text().Trim(); @@ -163,4 +165,4 @@ namespace Jackett.Common.Indexers.Abstract return releases; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/Abstract/CouchPotatoTracker.cs b/src/Jackett.Common/Indexers/Abstract/CouchPotatoTracker.cs index 5c7317f0d..594904d44 100644 --- a/src/Jackett.Common/Indexers/Abstract/CouchPotatoTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/CouchPotatoTracker.cs @@ -60,9 +60,9 @@ namespace Jackett.Common.Indexers.Abstract var searchUrl = APIUrl; var queryCollection = new NameValueCollection(); - + if (!string.IsNullOrEmpty(query.ImdbID)) - { + { queryCollection.Add("imdbid", query.ImdbID); } if (searchString != null) diff --git a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs index 24418c97d..ca5425328 100644 --- a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -235,8 +235,9 @@ namespace Jackett.Common.Indexers.Abstract var torrentId = torrent["torrentId"]; var time = (string)torrent["time"]; - if (!string.IsNullOrEmpty(time)) { - release.PublishDate = DateTime.ParseExact(time+" +0000", "yyyy-MM-dd HH:mm:ss zzz", CultureInfo.InvariantCulture); + if (!string.IsNullOrEmpty(time)) + { + release.PublishDate = DateTime.ParseExact(time + " +0000", "yyyy-MM-dd HH:mm:ss zzz", CultureInfo.InvariantCulture); } var flags = new List(); @@ -249,7 +250,7 @@ namespace Jackett.Common.Indexers.Abstract if (!string.IsNullOrEmpty(encoding)) flags.Add(encoding); - if(torrent["hasLog"] != null && (bool)torrent["hasLog"]) + if (torrent["hasLog"] != null && (bool)torrent["hasLog"]) { var logScore = (string)torrent["logScore"]; flags.Add("Log (" + logScore + "%)"); diff --git a/src/Jackett.Common/Indexers/AlphaRatio.cs b/src/Jackett.Common/Indexers/AlphaRatio.cs index c6467a48b..6945fe3e1 100644 --- a/src/Jackett.Common/Indexers/AlphaRatio.cs +++ b/src/Jackett.Common/Indexers/AlphaRatio.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; diff --git a/src/Jackett.Common/Indexers/AniDub.cs b/src/Jackett.Common/Indexers/AniDub.cs index 5db768cbc..abaa25957 100644 --- a/src/Jackett.Common/Indexers/AniDub.cs +++ b/src/Jackett.Common/Indexers/AniDub.cs @@ -1,4 +1,4 @@ -using AngleSharp.Dom; +using AngleSharp.Dom; using AngleSharp.Html.Parser; using Jackett.Common.Models; using Jackett.Common.Models.IndexerConfig.Bespoke; @@ -342,12 +342,18 @@ namespace Jackett.Common.Indexers var quality = releaseNode.Id.Trim(); switch (quality.ToLowerInvariant()) { - case "tv720": return "HDTV 720p"; - case "tv1080": return "HDTV 1080p"; - case "bd720": return "BDRip 720p"; - case "bd1080": return "BDRip 1080p"; - case "hwp": return "SDTV"; - default: return quality.ToUpperInvariant(); + case "tv720": + return "HDTV 720p"; + case "tv1080": + return "HDTV 1080p"; + case "bd720": + return "BDRip 720p"; + case "bd1080": + return "BDRip 1080p"; + case "hwp": + return "SDTV"; + default: + return quality.ToUpperInvariant(); } } diff --git a/src/Jackett.Common/Indexers/AnimeBytes.cs b/src/Jackett.Common/Indexers/AnimeBytes.cs index 88e29f393..e00495c40 100644 --- a/src/Jackett.Common/Indexers/AnimeBytes.cs +++ b/src/Jackett.Common/Indexers/AnimeBytes.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -164,7 +164,7 @@ namespace Jackett.Common.Indexers queryCollection.Add("type", searchType); queryCollection.Add("searchstr", searchTerm); var queryUrl = ScrapeUrl + "?" + queryCollection.GetQueryString(); - + // Check cache first so we don't query the server for each episode when searching for each episode in a series. lock (cache) { @@ -190,7 +190,7 @@ namespace Jackett.Common.Indexers var Matches = (long)json["Matches"]; - if(Matches > 0) + if (Matches > 0) { var groups = (JArray)json.Groups; @@ -208,7 +208,8 @@ namespace Jackett.Common.Indexers mainTitle = SeriesName; synonyms.Add(mainTitle); - if (AddSynonyms){ + if (AddSynonyms) + { foreach (string synonym in group["Synonymns"]) synonyms.Add(synonym); } @@ -347,7 +348,7 @@ namespace Jackett.Common.Indexers if (!AllowRaws && releaseTags.Contains("raw", StringComparer.InvariantCultureIgnoreCase)) continue; - var infoString = releaseTags.Aggregate("", (prev, cur) => prev + "[" + cur + "]" ); + var infoString = releaseTags.Aggregate("", (prev, cur) => prev + "[" + cur + "]"); var MinimumSeedTime = 259200; // Additional 5 hours per GB MinimumSeedTime += (int)((Size / 1000000000) * 18000); diff --git a/src/Jackett.Common/Indexers/AnimeTorrents.cs b/src/Jackett.Common/Indexers/AnimeTorrents.cs index b397bfc52..609c8b76c 100644 --- a/src/Jackett.Common/Indexers/AnimeTorrents.cs +++ b/src/Jackett.Common/Indexers/AnimeTorrents.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/Anthelion.cs b/src/Jackett.Common/Indexers/Anthelion.cs index 8b631196b..c5df3841c 100644 --- a/src/Jackett.Common/Indexers/Anthelion.cs +++ b/src/Jackett.Common/Indexers/Anthelion.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; @@ -33,4 +33,4 @@ namespace Jackett.Common.Indexers AddCategoryMapping(4, TorznabCatType.Movies, "Other"); } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/Avistaz.cs b/src/Jackett.Common/Indexers/Avistaz.cs index 9ec24b226..889740fb5 100644 --- a/src/Jackett.Common/Indexers/Avistaz.cs +++ b/src/Jackett.Common/Indexers/Avistaz.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; @@ -27,4 +27,4 @@ namespace Jackett.Common.Indexers return query.SanitizedSearchTerm; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/BB.cs b/src/Jackett.Common/Indexers/BB.cs index 7e6eb2a8c..dca37debf 100644 --- a/src/Jackett.Common/Indexers/BB.cs +++ b/src/Jackett.Common/Indexers/BB.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; diff --git a/src/Jackett.Common/Indexers/BJShare.cs b/src/Jackett.Common/Indexers/BJShare.cs index 141172b43..ea81c6a1e 100644 --- a/src/Jackett.Common/Indexers/BJShare.cs +++ b/src/Jackett.Common/Indexers/BJShare.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -30,7 +30,7 @@ namespace Jackett.Common.Indexers { "tell me a story us", "Tell Me a Story"}, { "greys anatomy", "grey's anatomy"} }; - + private readonly Dictionary _commonResultTerms = new Dictionary { { "tell me a story", "Tell Me a Story US"}, @@ -38,12 +38,12 @@ namespace Jackett.Common.Indexers { "agents of s.h.i.e.l.d.", "Marvels Agents of SHIELD"}, { "legends of tomorrow", "DCs Legends of Tomorrow"} }; - + private readonly List _absoluteNumbering = new List { "One Piece", "Boruto", "Black Clover", "Fairy Tail", "Super Dragon Ball Heroes" }; - + public override string[] LegacySiteLinks { get; protected set; } = new string[] { "https://bj-share.me/" }; @@ -158,7 +158,7 @@ namespace Jackett.Common.Indexers // until they or the source from where they get that info fix it... if (IsAbsoluteNumbering(title)) - { + { title = Regex.Replace(title, @"(Ep[\.]?[ ]?)|([S]\d\d[Ee])", ""); return title; } @@ -171,14 +171,14 @@ namespace Jackett.Common.Indexers } else { - return title; + return title; } } protected override async Task> PerformQuery(TorznabQuery query) { query = query.Clone(); // avoid modifing the original query - + var releases = new List(); // if the search string is empty use the "last 24h torrents" view @@ -231,7 +231,8 @@ namespace Jackett.Common.Indexers var line = child.TextContent; if (line.StartsWith("Tamanho:")) { - var size = line.Substring("Tamanho: ".Length); ; + var size = line.Substring("Tamanho: ".Length); + ; release.Size = ReleaseInfo.GetBytes(size); } else if (line.StartsWith("Lançado em: ")) @@ -243,7 +244,8 @@ namespace Jackett.Common.Indexers } else if (line.StartsWith("Ano:")) { - year = line.Substring("Ano: ".Length); ; + year = line.Substring("Ano: ".Length); + ; } else @@ -255,7 +257,7 @@ namespace Jackett.Common.Indexers var catStr = qCatLink.GetAttribute("href").Split('=')[1]; release.Title = FixAbsoluteNumbering(release.Title); - if(year != "") + if (year != "") { release.Title += " " + year; } @@ -407,7 +409,7 @@ namespace Jackett.Common.Indexers var cleanTitle = Regex.Replace(groupTitle, @" - ((S(\d{2}))?E(\d{1,4}))", ""); // Get international title if available, or use the full title if not cleanTitle = InternationalTitle(cleanTitle); - + foreach (var resultTerm in _commonResultTerms) { var newTitle = cleanTitle.ToLower().Replace(resultTerm.Key.ToLower(), resultTerm.Value); @@ -416,7 +418,7 @@ namespace Jackett.Common.Indexers cleanTitle = newTitle; } } - + title = Regex.Replace(title.Trim(), @"\s+", " "); var seasonEp = Regex.Replace(title, @"((S\d{2})?(E\d{2,4})?) .*", "$1"); if (seasonEp[0] == '[') @@ -442,7 +444,7 @@ namespace Jackett.Common.Indexers var cleanTitle = Regex.Replace(title, @" - ((S\d{2})?(E\d{2,4})?)", ""); // Get international title if available, or use the full title if not cleanTitle = InternationalTitle(cleanTitle); - + foreach (var resultTerm in _commonResultTerms) { var newTitle = cleanTitle.ToLower().Replace(resultTerm.Key.ToLower(), resultTerm.Value); @@ -451,7 +453,7 @@ namespace Jackett.Common.Indexers cleanTitle = newTitle; } } - + var seasonEp = Regex.Replace(title, @"^(.*?) - ((S\d{2})?(E\d{2,4})?)", "$2"); if (seasonEp[0] == '[') seasonEp = ""; @@ -484,7 +486,7 @@ namespace Jackett.Common.Indexers release.Description = release.Description.Replace("SD", "480p"); release.Description = release.Description.Replace("Dual Áudio", "Dual"); // If it ain't nacional there will be the type of the audio / original audio - if(release.Description.IndexOf("Nacional") == -1) + if (release.Description.IndexOf("Nacional") == -1) { release.Description = Regex.Replace(release.Description, @"(Dual|Legendado|Dublado) \/ (.*?) \/", "$1 /"); } @@ -493,7 +495,7 @@ namespace Jackett.Common.Indexers var cleanDescription = release.Description.Trim().TrimStart('[').TrimEnd(']'); String[] titleElements; - + //Formats the title so it can be parsed later string[] stringSeparators = new string[] { " / " }; titleElements = cleanDescription.Split(stringSeparators, StringSplitOptions.None); diff --git a/src/Jackett.Common/Indexers/BakaBT.cs b/src/Jackett.Common/Indexers/BakaBT.cs index 49fb24bb6..a52d8b782 100644 --- a/src/Jackett.Common/Indexers/BakaBT.cs +++ b/src/Jackett.Common/Indexers/BakaBT.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Net; @@ -209,4 +209,4 @@ namespace Jackett.Common.Indexers return response.Content; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index 2e16a7350..ec02b9004 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using Jackett.Common.Models; using Jackett.Common.Models.IndexerConfig; using Jackett.Common.Services.Interfaces; @@ -624,7 +624,8 @@ namespace Jackett.Common.Indexers var matches = expression.Match(redirRequestCookies); while (matches.Success) { - if (matches.Groups.Count > 2) cookieDIctionary[matches.Groups[1].Value] = matches.Groups[2].Value; + if (matches.Groups.Count > 2) + cookieDIctionary[matches.Groups[1].Value] = matches.Groups[2].Value; matches = matches.NextMatch(); } return string.Join("; ", cookieDIctionary diff --git a/src/Jackett.Common/Indexers/BitCityReloaded.cs b/src/Jackett.Common/Indexers/BitCityReloaded.cs index 376c74549..8b265d944 100644 --- a/src/Jackett.Common/Indexers/BitCityReloaded.cs +++ b/src/Jackett.Common/Indexers/BitCityReloaded.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -45,14 +45,14 @@ namespace Jackett.Common.Indexers this.configData.DisplayText.Value = "Only the results from the first search result page are shown, adjust your profile settings to show a reasonable amount (it looks like there's no maximum)."; this.configData.DisplayText.Name = "Notice"; - AddCategoryMapping(1, TorznabCatType.Other); // Anderes - AddCategoryMapping(2, TorznabCatType.TVAnime); // Anime + AddCategoryMapping(1, TorznabCatType.Other); // Anderes + AddCategoryMapping(2, TorznabCatType.TVAnime); // Anime AddCategoryMapping(34, TorznabCatType.PC); // Appz/Linux AddCategoryMapping(35, TorznabCatType.PCMac); // Appz/Mac AddCategoryMapping(36, TorznabCatType.PC); // Appz/Other AddCategoryMapping(20, TorznabCatType.PC); // Appz/Win - AddCategoryMapping(3, TorznabCatType.TVDocumentary); // Doku/Alle Formate - AddCategoryMapping(4, TorznabCatType.Books); // EBooks + AddCategoryMapping(3, TorznabCatType.TVDocumentary); // Doku/Alle Formate + AddCategoryMapping(4, TorznabCatType.Books); // EBooks AddCategoryMapping(12, TorznabCatType.ConsolePS4); // Games PS / PSX AddCategoryMapping(11, TorznabCatType.ConsoleNDS); // Games/Nintendo DS AddCategoryMapping(10, TorznabCatType.PCGames); // Games/PC @@ -63,11 +63,11 @@ namespace Jackett.Common.Indexers AddCategoryMapping(30, TorznabCatType.Other); // International AddCategoryMapping(17, TorznabCatType.Other); // MegaPack AddCategoryMapping(43, TorznabCatType.Movies3D); // Movie/3D - AddCategoryMapping(5, TorznabCatType.MoviesDVD); // Movie/DVD/R - AddCategoryMapping(6, TorznabCatType.MoviesHD); // Movie/HD 1080p - AddCategoryMapping(7, TorznabCatType.MoviesHD); // Movie/HD 720p + AddCategoryMapping(5, TorznabCatType.MoviesDVD); // Movie/DVD/R + AddCategoryMapping(6, TorznabCatType.MoviesHD); // Movie/HD 1080p + AddCategoryMapping(7, TorznabCatType.MoviesHD); // Movie/HD 720p AddCategoryMapping(32, TorznabCatType.MoviesOther); // Movie/TVRip - AddCategoryMapping(9, TorznabCatType.MoviesOther); // Movie/XviD,DivX,h264 + AddCategoryMapping(9, TorznabCatType.MoviesOther); // Movie/XviD,DivX,h264 AddCategoryMapping(26, TorznabCatType.XXX); // Movie/XXX AddCategoryMapping(41, TorznabCatType.XXXOther); // Movie/XXX/Other AddCategoryMapping(42, TorznabCatType.XXXPacks); // Movie/XXX/Pack @@ -105,7 +105,7 @@ namespace Jackett.Common.Indexers protected override async Task> PerformQuery(TorznabQuery query) { var releases = new List(); - + var searchString = query.GetQueryString(); var searchUrl = BrowseUrl; var queryCollection = new NameValueCollection(); @@ -145,14 +145,15 @@ namespace Jackett.Common.Indexers var qRow = row.Cq(); var flagImgs = qRow.Find("table tbody tr: eq(0) td > img"); List flags = new List(); - flagImgs.Each(flagImg => { + flagImgs.Each(flagImg => + { var flag = flagImg.GetAttribute("src").Replace("pic/torrent_", "").Replace(".gif", "").ToUpper(); if (flag == "OU") release.DownloadVolumeFactor = 0; else flags.Add(flag); }); - + var titleLink = qRow.Find("table tbody tr:eq(0) td a:has(b)").First(); var DLLink = qRow.Find("td.tableb > a:has(img[title=\"Torrent herunterladen\"])").First(); release.Comments = new Uri(SiteLink + titleLink.Attr("href").Replace("&hit=1", "")); diff --git a/src/Jackett.Common/Indexers/BitHdtv.cs b/src/Jackett.Common/Indexers/BitHdtv.cs index 796bc3a66..ffff225dc 100644 --- a/src/Jackett.Common/Indexers/BitHdtv.cs +++ b/src/Jackett.Common/Indexers/BitHdtv.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/BrokenStones.cs b/src/Jackett.Common/Indexers/BrokenStones.cs index c312787a6..5594d34eb 100644 --- a/src/Jackett.Common/Indexers/BrokenStones.cs +++ b/src/Jackett.Common/Indexers/BrokenStones.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; diff --git a/src/Jackett.Common/Indexers/CardigannIndexer.cs b/src/Jackett.Common/Indexers/CardigannIndexer.cs index a19ab21c4..7503ef4b6 100644 --- a/src/Jackett.Common/Indexers/CardigannIndexer.cs +++ b/src/Jackett.Common/Indexers/CardigannIndexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -135,7 +135,8 @@ namespace Jackett.Common.Indexers } else { - item = new StringItem { Value = Setting.Default }; ; + item = new StringItem { Value = Setting.Default }; + ; } item.Name = Setting.Label; @@ -423,7 +424,7 @@ namespace Jackett.Common.Indexers protected bool checkForError(WebClientStringResult loginResult, IList errorBlocks) { - if(loginResult.Status == HttpStatusCode.Unauthorized) // e.g. used by YGGtorrent + if (loginResult.Status == HttpStatusCode.Unauthorized) // e.g. used by YGGtorrent throw new ExceptionWithConfigData("401 Unauthorized, check your credentials", configData); if (errorBlocks == null) diff --git a/src/Jackett.Common/Indexers/CinemaZ.cs b/src/Jackett.Common/Indexers/CinemaZ.cs index 083bd0fa5..bb9883e74 100644 --- a/src/Jackett.Common/Indexers/CinemaZ.cs +++ b/src/Jackett.Common/Indexers/CinemaZ.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; using NLog; @@ -20,4 +20,4 @@ namespace Jackett.Common.Indexers Type = "private"; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/Corsarored.cs b/src/Jackett.Common/Indexers/Corsarored.cs index d9242786c..ce8f9e9bd 100644 --- a/src/Jackett.Common/Indexers/Corsarored.cs +++ b/src/Jackett.Common/Indexers/Corsarored.cs @@ -13,240 +13,241 @@ using NLog; namespace Jackett.Common.Indexers { - public class Corsarored : BaseWebIndexer - { - private const int MaxSearchPageLimit = 4; - private const int MaxResultsPerPage = 25; + public class Corsarored : BaseWebIndexer + { + private const int MaxSearchPageLimit = 4; + private const int MaxResultsPerPage = 25; - private readonly Dictionary _apiCategories = new Dictionary - { - // 0 = Misc. Probably only shows up in search all anyway - ["0"] = new[] {"25", "27"}, - // 1 = TV - ["1"] = new[] {"1", "14", "22", "23", "24", "29", "31"}, - // 2 = Movies - ["2"] = new[] {"4"}, - // 3 = Music/podcasts/audiobooks - ["3"] = new[] {"2", "21", "34", "35"}, - // 4 = ebooks - ["4"] = new[] {"3", "13", "30", "36"}, - // 5 = Software - ["5"] = new[] {"6", "9", "10", "37"}, - // 6 = Video Games - ["6"] = new[] {"11", "12", "26", "28", "32"}, - // 7 = Anime - ["7"] = new[] {"7", "8"} - }; + private readonly Dictionary _apiCategories = new Dictionary + { + // 0 = Misc. Probably only shows up in search all anyway + ["0"] = new[] { "25", "27" }, + // 1 = TV + ["1"] = new[] { "1", "14", "22", "23", "24", "29", "31" }, + // 2 = Movies + ["2"] = new[] { "4" }, + // 3 = Music/podcasts/audiobooks + ["3"] = new[] { "2", "21", "34", "35" }, + // 4 = ebooks + ["4"] = new[] { "3", "13", "30", "36" }, + // 5 = Software + ["5"] = new[] { "6", "9", "10", "37" }, + // 6 = Video Games + ["6"] = new[] { "11", "12", "26", "28", "32" }, + // 7 = Anime + ["7"] = new[] { "7", "8" } + }; - private readonly Dictionary _apiHeaders = new Dictionary - { - ["Content-Type"] = "application/json" - }; + private readonly Dictionary _apiHeaders = new Dictionary + { + ["Content-Type"] = "application/json" + }; - public Corsarored(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps) - : base("Corsaro.red", - description: "Italian Torrents", - link: "https://corsaro.red/", - caps: new TorznabCapabilities(), - configService: configService, - client: wc, - logger: l, - p: ps, - configData: new ConfigurationData()) - { - Encoding = Encoding.UTF8; - Language = "it-it"; - Type = "public"; + public Corsarored(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps) + : base("Corsaro.red", + description: "Italian Torrents", + link: "https://corsaro.red/", + caps: new TorznabCapabilities(), + configService: configService, + client: wc, + logger: l, + p: ps, + configData: new ConfigurationData()) + { + Encoding = Encoding.UTF8; + Language = "it-it"; + Type = "public"; - // TNTVillage cats - AddCategoryMapping(1, TorznabCatType.TV, "TV Movies"); - AddCategoryMapping(2, TorznabCatType.Audio, "Music"); - AddCategoryMapping(3, TorznabCatType.BooksEbook, "eBooks"); - AddCategoryMapping(4, TorznabCatType.Movies, "Movies"); - AddCategoryMapping(6, TorznabCatType.PC, "Linux"); - AddCategoryMapping(7, TorznabCatType.TVAnime, "Anime"); - AddCategoryMapping(8, TorznabCatType.TVAnime, "Cartoons"); - AddCategoryMapping(9, TorznabCatType.PC, "Mac Software"); - AddCategoryMapping(10, TorznabCatType.PC, "Windows Software"); - AddCategoryMapping(11, TorznabCatType.PCGames, "PC Games"); - AddCategoryMapping(12, TorznabCatType.Console, "Playstation Games"); - AddCategoryMapping(13, TorznabCatType.Books, "Textbooks"); - AddCategoryMapping(14, TorznabCatType.TVDocumentary, "Documentaries"); - AddCategoryMapping(21, TorznabCatType.AudioVideo, "Music Video"); - AddCategoryMapping(22, TorznabCatType.TVSport, "Sport"); - AddCategoryMapping(23, TorznabCatType.TV, "Theater"); - AddCategoryMapping(24, TorznabCatType.TV, "Wrestling"); - AddCategoryMapping(25, TorznabCatType.OtherMisc, "Other"); - AddCategoryMapping(26, TorznabCatType.Console, "Xbox Games"); - AddCategoryMapping(27, TorznabCatType.Other, "Wallpaper"); - AddCategoryMapping(28, TorznabCatType.ConsoleOther, "Other Games"); - AddCategoryMapping(29, TorznabCatType.TV, "TV Series"); - AddCategoryMapping(30, TorznabCatType.BooksComics, "Comics"); - AddCategoryMapping(31, TorznabCatType.TV, "TV"); - AddCategoryMapping(32, TorznabCatType.Console, "Nintendo Games"); - AddCategoryMapping(34, TorznabCatType.AudioAudiobook, "Audiobook"); - AddCategoryMapping(35, TorznabCatType.Audio, "Podcasts"); - AddCategoryMapping(36, TorznabCatType.BooksMagazines, "Newspapers"); - AddCategoryMapping(37, TorznabCatType.PCPhoneOther, "Phone Apps"); - } + // TNTVillage cats + AddCategoryMapping(1, TorznabCatType.TV, "TV Movies"); + AddCategoryMapping(2, TorznabCatType.Audio, "Music"); + AddCategoryMapping(3, TorznabCatType.BooksEbook, "eBooks"); + AddCategoryMapping(4, TorznabCatType.Movies, "Movies"); + AddCategoryMapping(6, TorznabCatType.PC, "Linux"); + AddCategoryMapping(7, TorznabCatType.TVAnime, "Anime"); + AddCategoryMapping(8, TorznabCatType.TVAnime, "Cartoons"); + AddCategoryMapping(9, TorznabCatType.PC, "Mac Software"); + AddCategoryMapping(10, TorznabCatType.PC, "Windows Software"); + AddCategoryMapping(11, TorznabCatType.PCGames, "PC Games"); + AddCategoryMapping(12, TorznabCatType.Console, "Playstation Games"); + AddCategoryMapping(13, TorznabCatType.Books, "Textbooks"); + AddCategoryMapping(14, TorznabCatType.TVDocumentary, "Documentaries"); + AddCategoryMapping(21, TorznabCatType.AudioVideo, "Music Video"); + AddCategoryMapping(22, TorznabCatType.TVSport, "Sport"); + AddCategoryMapping(23, TorznabCatType.TV, "Theater"); + AddCategoryMapping(24, TorznabCatType.TV, "Wrestling"); + AddCategoryMapping(25, TorznabCatType.OtherMisc, "Other"); + AddCategoryMapping(26, TorznabCatType.Console, "Xbox Games"); + AddCategoryMapping(27, TorznabCatType.Other, "Wallpaper"); + AddCategoryMapping(28, TorznabCatType.ConsoleOther, "Other Games"); + AddCategoryMapping(29, TorznabCatType.TV, "TV Series"); + AddCategoryMapping(30, TorznabCatType.BooksComics, "Comics"); + AddCategoryMapping(31, TorznabCatType.TV, "TV"); + AddCategoryMapping(32, TorznabCatType.Console, "Nintendo Games"); + AddCategoryMapping(34, TorznabCatType.AudioAudiobook, "Audiobook"); + AddCategoryMapping(35, TorznabCatType.Audio, "Podcasts"); + AddCategoryMapping(36, TorznabCatType.BooksMagazines, "Newspapers"); + AddCategoryMapping(37, TorznabCatType.PCPhoneOther, "Phone Apps"); + } - private string ApiLatest => $"{SiteLink}api/latests"; - private string ApiSearch => $"{SiteLink}api/search"; + private string ApiLatest => $"{SiteLink}api/latests"; + private string ApiSearch => $"{SiteLink}api/search"; - public override async Task ApplyConfiguration(JToken configJson) - { - base.LoadValuesFromJson(configJson); - var releases = await PerformQuery(new TorznabQuery()); + public override async Task ApplyConfiguration(JToken configJson) + { + base.LoadValuesFromJson(configJson); + var releases = await PerformQuery(new TorznabQuery()); - await ConfigureIfOK(string.Empty, releases.Any(), - () => throw new Exception("Could not find release from this URL.")); + await ConfigureIfOK(string.Empty, releases.Any(), + () => throw new Exception("Could not find release from this URL.")); - return IndexerConfigurationStatus.Completed; - } + return IndexerConfigurationStatus.Completed; + } - private dynamic CheckResponse(WebClientStringResult result) - { - try - { - var json = JsonConvert.DeserializeObject(result.Content); + private dynamic CheckResponse(WebClientStringResult result) + { + try + { + var json = JsonConvert.DeserializeObject(result.Content); - switch (json) - { - case JObject _ when json["ok"] != null && (bool) json["ok"] == false: - throw new Exception("Server error"); - default: - return json; - } - } - catch (Exception e) - { - logger.Error("checkResponse() Error: ", e.Message); - throw new ExceptionWithConfigData(result.Content, configData); - } - } + switch (json) + { + case JObject _ when json["ok"] != null && (bool)json["ok"] == false: + throw new Exception("Server error"); + default: + return json; + } + } + catch (Exception e) + { + logger.Error("checkResponse() Error: ", e.Message); + throw new ExceptionWithConfigData(result.Content, configData); + } + } - private async Task SendApiRequest(IEnumerable> data) - { - var result = await PostDataWithCookiesAndRetry(ApiSearch, data, null, SiteLink, _apiHeaders, null, true); - return CheckResponse(result); - } + private async Task SendApiRequest(IEnumerable> data) + { + var result = await PostDataWithCookiesAndRetry(ApiSearch, data, null, SiteLink, _apiHeaders, null, true); + return CheckResponse(result); + } - private async Task SendApiRequestLatest() - { - var result = await RequestStringWithCookiesAndRetry(ApiLatest, null, SiteLink, _apiHeaders); - return CheckResponse(result); - } + private async Task SendApiRequestLatest() + { + var result = await RequestStringWithCookiesAndRetry(ApiLatest, null, SiteLink, _apiHeaders); + return CheckResponse(result); + } - private string GetApiCategory(TorznabQuery query) - { - var cats = MapTorznabCapsToTrackers(query); - if (cats.Count == 0) return "0"; - string apiCat = null; - foreach (var cat in cats.Select(cat => - _apiCategories.FirstOrDefault(kvp => kvp.Value.Contains(cat)).Key)) - { - if (apiCat == null) - apiCat = cat; - if (apiCat != cat) - return "0"; + private string GetApiCategory(TorznabQuery query) + { + var cats = MapTorznabCapsToTrackers(query); + if (cats.Count == 0) + return "0"; + string apiCat = null; + foreach (var cat in cats.Select(cat => + _apiCategories.FirstOrDefault(kvp => kvp.Value.Contains(cat)).Key)) + { + if (apiCat == null) + apiCat = cat; + if (apiCat != cat) + return "0"; - } + } - return apiCat; - } + return apiCat; + } - protected override async Task> PerformQuery(TorznabQuery query) - { - var releases = new List(); - var searchString = query.GetQueryString(); + protected override async Task> PerformQuery(TorznabQuery query) + { + var releases = new List(); + var searchString = query.GetQueryString(); - if (string.IsNullOrWhiteSpace(searchString)) - { - // no term execute latest search - var result = await SendApiRequestLatest(); + if (string.IsNullOrWhiteSpace(searchString)) + { + // no term execute latest search + var result = await SendApiRequestLatest(); - try - { - // this time is a jarray - var json = (JArray) result; + try + { + // this time is a jarray + var json = (JArray)result; - releases.AddRange(json.Select(MakeRelease)); - } - catch (Exception ex) - { - OnParseError(result.ToString(), ex); - } + releases.AddRange(json.Select(MakeRelease)); + } + catch (Exception ex) + { + OnParseError(result.ToString(), ex); + } - return releases; - } + return releases; + } - var queryCollection = new Dictionary - { - ["term"] = searchString, - ["category"] = GetApiCategory(query) - }; + var queryCollection = new Dictionary + { + ["term"] = searchString, + ["category"] = GetApiCategory(query) + }; - for (var page = 1; page <= MaxSearchPageLimit; page++) - { - // update page number - queryCollection["page"] = page.ToString(); + for (var page = 1; page <= MaxSearchPageLimit; page++) + { + // update page number + queryCollection["page"] = page.ToString(); - var result = await SendApiRequest(queryCollection); - try - { - // this time is a jobject - var json = (JObject) result; + var result = await SendApiRequest(queryCollection); + try + { + // this time is a jobject + var json = (JObject)result; - // throws exception if json["results"] is null or not a JArray - if(json["results"] == null) - throw new Exception("Error invalid JSON response"); + // throws exception if json["results"] is null or not a JArray + if (json["results"] == null) + throw new Exception("Error invalid JSON response"); - var results = json["results"].Select(MakeRelease).ToList(); - releases.AddRange(results); - if (results.Count < MaxResultsPerPage) - break; - } - catch (Exception ex) - { - OnParseError(result.ToString(), ex); - } - } + var results = json["results"].Select(MakeRelease).ToList(); + releases.AddRange(results); + if (results.Count < MaxResultsPerPage) + break; + } + catch (Exception ex) + { + OnParseError(result.ToString(), ex); + } + } - return releases; - } + return releases; + } - private ReleaseInfo MakeRelease(JToken torrent) - { - //https://corsaro.red/details/E5BB62E2E58C654F4450325046723A3F013CD7A4 - var release = new ReleaseInfo - { - Title = (string) torrent["title"], - Grabs = (long) torrent["completed"], - Description = $"{(string) torrent["category"]} {(string) torrent["description"]}", - Seeders = (int) torrent["seeders"], - InfoHash = (string) torrent["hash"], - MagnetUri = new Uri((string) torrent["magnet"]), - Comments = new Uri($"{SiteLink}details/{(string) torrent["hash"]}"), - MinimumRatio = 1, - MinimumSeedTime = 172800, // 48 hours - DownloadVolumeFactor = 0, - UploadVolumeFactor = 1 - }; + private ReleaseInfo MakeRelease(JToken torrent) + { + //https://corsaro.red/details/E5BB62E2E58C654F4450325046723A3F013CD7A4 + var release = new ReleaseInfo + { + Title = (string)torrent["title"], + Grabs = (long)torrent["completed"], + Description = $"{(string)torrent["category"]} {(string)torrent["description"]}", + Seeders = (int)torrent["seeders"], + InfoHash = (string)torrent["hash"], + MagnetUri = new Uri((string)torrent["magnet"]), + Comments = new Uri($"{SiteLink}details/{(string)torrent["hash"]}"), + MinimumRatio = 1, + MinimumSeedTime = 172800, // 48 hours + DownloadVolumeFactor = 0, + UploadVolumeFactor = 1 + }; - release.Guid = release.Comments; - release.Peers = release.Seeders + (int) torrent["leechers"]; + release.Guid = release.Comments; + release.Peers = release.Seeders + (int)torrent["leechers"]; - release.PublishDate = DateTime.Now; - if (torrent["last_updated"] != null) - release.PublishDate = DateTime.Parse((string) torrent["last_updated"]); + release.PublishDate = DateTime.Now; + if (torrent["last_updated"] != null) + release.PublishDate = DateTime.Parse((string)torrent["last_updated"]); - var cat = (int) torrent["category"]; - release.Category = MapTrackerCatToNewznab(cat.ToString()); + var cat = (int)torrent["category"]; + release.Category = MapTrackerCatToNewznab(cat.ToString()); - if (torrent["size"] != null) - release.Size = (long) torrent["size"]; + if (torrent["size"] != null) + release.Size = (long)torrent["size"]; - return release; - } - } -} \ No newline at end of file + return release; + } + } +} diff --git a/src/Jackett.Common/Indexers/DigitalHive.cs b/src/Jackett.Common/Indexers/DigitalHive.cs index b8ec7a041..635633e87 100644 --- a/src/Jackett.Common/Indexers/DigitalHive.cs +++ b/src/Jackett.Common/Indexers/DigitalHive.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; @@ -244,4 +244,4 @@ namespace Jackett.Common.Indexers return releases; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/DivxTotal.cs b/src/Jackett.Common/Indexers/DivxTotal.cs index 14e0441ca..670d11f5e 100644 --- a/src/Jackett.Common/Indexers/DivxTotal.cs +++ b/src/Jackett.Common/Indexers/DivxTotal.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -91,7 +91,7 @@ namespace Jackett.Common.Indexers // we remove parts from the original query query = ParseQuery(query); - var qc = new NameValueCollection {{"s", query.SearchTerm}}; + var qc = new NameValueCollection { { "s", query.SearchTerm } }; var page = 1; var isLastPage = false; @@ -112,11 +112,12 @@ namespace Jackett.Common.Indexers if (table == null) break; var rows = table.QuerySelectorAll("tr"); - isLastPage = rows.Length -1 <= MaxResultsPerPage; // rows includes the header + isLastPage = rows.Length - 1 <= MaxResultsPerPage; // rows includes the header var isHeader = true; foreach (var row in rows) { - if (isHeader) { + if (isHeader) + { isHeader = false; continue; } @@ -185,7 +186,8 @@ namespace Jackett.Common.Indexers if (cat == DivxTotalCategories.Series) { await ParseSeriesRelease(releases, query, commentsLink, cat, publishDate); - } else if (query.Episode == null) // if it's scene series, we don't return other categories + } + else if (query.Episode == null) // if it's scene series, we don't return other categories { if (cat == DivxTotalCategories.Peliculas || cat == DivxTotalCategories.PeliculasHd || cat == DivxTotalCategories.Peliculas3D || cat == DivxTotalCategories.PeliculasDvdr) @@ -216,7 +218,8 @@ namespace Jackett.Common.Indexers var isHeader = true; foreach (var row in rows) { - if (isHeader) { + if (isHeader) + { isHeader = false; continue; } @@ -273,8 +276,8 @@ namespace Jackett.Common.Indexers title += " SPANISH BDRip x264"; else if (cat == DivxTotalCategories.PeliculasDvdr) { - title += " SPANISH DVDR"; - size = TryToParseSize(sizeStr, DivxTotalFizeSizes.PeliculasDvdr); + title += " SPANISH DVDR"; + size = TryToParseSize(sizeStr, DivxTotalFizeSizes.PeliculasDvdr); } else throw new Exception("Unknown category " + cat); @@ -323,13 +326,13 @@ namespace Jackett.Common.Indexers // this code split the words, remove words with 2 letters or less, remove accents and lowercase var queryMatches = Regex.Matches(queryStr, @"\b[\w']*\b"); var queryWords = from m in queryMatches.Cast() - where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 - select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); + where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 + select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); var titleMatches = Regex.Matches(title, @"\b[\w']*\b"); var titleWords = from m in titleMatches.Cast() - where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 - select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); + where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 + select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); titleWords = titleWords.ToArray(); return queryWords.All(word => titleWords.Contains(word)); @@ -413,7 +416,7 @@ namespace Jackett.Common.Indexers private static long TryToParseSize(string sizeToParse, long sizeDefault) { try - { + { return ReleaseInfo.GetBytes(sizeToParse); } catch diff --git a/src/Jackett.Common/Indexers/EliteTracker.cs b/src/Jackett.Common/Indexers/EliteTracker.cs index bdcd8ae5a..4d5442431 100644 --- a/src/Jackett.Common/Indexers/EliteTracker.cs +++ b/src/Jackett.Common/Indexers/EliteTracker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/Jackett.Common/Indexers/Feeds/AnimeTosho.cs b/src/Jackett.Common/Indexers/Feeds/AnimeTosho.cs index 057a15232..59f71a280 100644 --- a/src/Jackett.Common/Indexers/Feeds/AnimeTosho.cs +++ b/src/Jackett.Common/Indexers/Feeds/AnimeTosho.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Text; using System.Xml.Linq; diff --git a/src/Jackett.Common/Indexers/Feeds/BaseFeedIndexer.cs b/src/Jackett.Common/Indexers/Feeds/BaseFeedIndexer.cs index 77ae642ed..605518ce8 100644 --- a/src/Jackett.Common/Indexers/Feeds/BaseFeedIndexer.cs +++ b/src/Jackett.Common/Indexers/Feeds/BaseFeedIndexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Jackett.Common.Models; diff --git a/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs b/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs index 940991b55..686ae2cd7 100644 --- a/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs +++ b/src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; diff --git a/src/Jackett.Common/Indexers/FileList.cs b/src/Jackett.Common/Indexers/FileList.cs index 2bf940ea9..b6ea8de32 100644 --- a/src/Jackett.Common/Indexers/FileList.cs +++ b/src/Jackett.Common/Indexers/FileList.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -82,7 +82,7 @@ namespace Jackett.Common.Indexers LoadValuesFromJson(configJson); var responseFirstPage = await RequestStringWithCookiesAndRetry(SiteLink + "login.php?returnto=%2F", "", null); CQ domFirstPage = responseFirstPage.Content; - var validator = domFirstPage.Find("input[name =\"validator\"]").Attr("value"); + var validator = domFirstPage.Find("input[name =\"validator\"]").Attr("value"); var pairs = new Dictionary { { "validator", validator}, { "username", configData.Username.Value }, diff --git a/src/Jackett.Common/Indexers/FunFile.cs b/src/Jackett.Common/Indexers/FunFile.cs index 06dea14b2..15a1d1a08 100644 --- a/src/Jackett.Common/Indexers/FunFile.cs +++ b/src/Jackett.Common/Indexers/FunFile.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; @@ -44,12 +44,12 @@ namespace Jackett.Common.Indexers AddCategoryMapping(22, TorznabCatType.PC); // Applications AddCategoryMapping(43, TorznabCatType.AudioAudiobook); // Audio Books AddCategoryMapping(27, TorznabCatType.Books); // Ebook - AddCategoryMapping(4, TorznabCatType.PCGames); // Games + AddCategoryMapping(4, TorznabCatType.PCGames); // Games AddCategoryMapping(40, TorznabCatType.OtherMisc); // Miscellaneous AddCategoryMapping(19, TorznabCatType.Movies); // Movies - AddCategoryMapping(6, TorznabCatType.Audio); // Music + AddCategoryMapping(6, TorznabCatType.Audio); // Music AddCategoryMapping(31, TorznabCatType.PCPhoneOther); // Portable - AddCategoryMapping(7, TorznabCatType.TV); // TV + AddCategoryMapping(7, TorznabCatType.TV); // TV } public override async Task ApplyConfiguration(JToken configJson) diff --git a/src/Jackett.Common/Indexers/Fuzer.cs b/src/Jackett.Common/Indexers/Fuzer.cs index d60d383ca..38ef778c7 100644 --- a/src/Jackett.Common/Indexers/Fuzer.cs +++ b/src/Jackett.Common/Indexers/Fuzer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -329,7 +329,8 @@ namespace Jackett.Common.Indexers if (link.Text().Trim().ToLower() == searchTerm.Trim().ToLower()) { var address = link.Attr("href"); - if (string.IsNullOrEmpty(address)) { continue; } + if (string.IsNullOrEmpty(address)) + { continue; } var realAddress = site + address.Replace("lid=7", "lid=24"); var realData = await RequestStringWithCookies(realAddress); diff --git a/src/Jackett.Common/Indexers/GazelleGames.cs b/src/Jackett.Common/Indexers/GazelleGames.cs index c1b202abf..4a0194de4 100644 --- a/src/Jackett.Common/Indexers/GazelleGames.cs +++ b/src/Jackett.Common/Indexers/GazelleGames.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -216,7 +216,7 @@ namespace Jackett.Common.Indexers var i = 0; foreach (var cat in MapTorznabCapsToTrackers(query)) { - queryCollection.Add("artistcheck["+i+"]", cat); + queryCollection.Add("artistcheck[" + i + "]", cat); i++; } @@ -278,14 +278,14 @@ namespace Jackett.Common.Indexers var qDLLink = Row.QuerySelector("a[href^=\"torrents.php?action=download\"]"); var qTime = Row.QuerySelector("span.time"); // some users have an extra colum (8), we can't use nth-last-child - var qSize = Row.QuerySelector("td:nth-child(4)"); + var qSize = Row.QuerySelector("td:nth-child(4)"); var qGrabs = Row.QuerySelector("td:nth-child(5)"); var qSeeders = Row.QuerySelector("td:nth-child(6)"); var qLeechers = Row.QuerySelector("td:nth-child(7)"); var qFreeLeech = Row.QuerySelector("strong.freeleech_label"); var qNeutralLeech = Row.QuerySelector("strong.neutralleech_label"); var RowTitle = Row.GetAttribute("title"); - + var Time = qTime.GetAttribute("title"); release.PublishDate = DateTime.SpecifyKind(DateTime.ParseExact(Time, "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture), DateTimeKind.Unspecified).ToLocalTime(); release.Category = GroupCategory; diff --git a/src/Jackett.Common/Indexers/GimmePeers.cs b/src/Jackett.Common/Indexers/GimmePeers.cs index 7af306baf..1c96ac657 100644 --- a/src/Jackett.Common/Indexers/GimmePeers.cs +++ b/src/Jackett.Common/Indexers/GimmePeers.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/HDBitsApi.cs b/src/Jackett.Common/Indexers/HDBitsApi.cs index 58bb86df8..4d370cb4e 100644 --- a/src/Jackett.Common/Indexers/HDBitsApi.cs +++ b/src/Jackett.Common/Indexers/HDBitsApi.cs @@ -111,8 +111,8 @@ namespace Jackett.Common.Indexers { var release = new ReleaseInfo(); release.Title = (string)r["name"]; - release.Comments = new Uri(SiteLink+"details.php?id="+(string)r["id"]); - release.Link = new Uri(SiteLink+"download.php/"+(string)r["filename"]+"?id="+(string)r["id"]+"&passkey="+configData.Passkey.Value); + release.Comments = new Uri(SiteLink + "details.php?id=" + (string)r["id"]); + release.Link = new Uri(SiteLink + "download.php/" + (string)r["filename"] + "?id=" + (string)r["id"] + "&passkey=" + configData.Passkey.Value); release.Guid = release.Link; if (r.ContainsKey("imdb")) @@ -126,7 +126,7 @@ namespace Jackett.Common.Indexers } release.UploadVolumeFactor = 1; - int[] mediumsFor50 = {1,5,4}; + int[] mediumsFor50 = { 1, 5, 4 }; // 100% Neutral Leech: all XXX content. if ((int)r["type_category"] == 7) diff --git a/src/Jackett.Common/Indexers/HDOlimpo.cs b/src/Jackett.Common/Indexers/HDOlimpo.cs index 987a3d3e7..2e4e0b627 100644 --- a/src/Jackett.Common/Indexers/HDOlimpo.cs +++ b/src/Jackett.Common/Indexers/HDOlimpo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -158,7 +158,7 @@ namespace Jackett.Common.Indexers release.Title = (string)torrent["titulo"] + " " + (string)torrent["titulo_extra"]; // for downloading "premium" torrents you need special account - if ((string) torrent["premium"] == "si") + if ((string)torrent["premium"] == "si") { if (includePremium) release.Title += " [PREMIUM]"; @@ -181,7 +181,7 @@ namespace Jackett.Common.Indexers release.Grabs = (long)torrent["snatched"]; release.InfoHash = (string)torrent["plain_info_hash"]; - release.Link = new Uri(DownloadUrl + (string) torrent["id"]); + release.Link = new Uri(DownloadUrl + (string)torrent["id"]); var files = (JArray)JsonConvert.DeserializeObject((string)torrent["files_list"]); release.Files = files.Count; diff --git a/src/Jackett.Common/Indexers/HDOnly.cs b/src/Jackett.Common/Indexers/HDOnly.cs index e93dca8f3..d04b75e60 100644 --- a/src/Jackett.Common/Indexers/HDOnly.cs +++ b/src/Jackett.Common/Indexers/HDOnly.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; diff --git a/src/Jackett.Common/Indexers/HDSpace.cs b/src/Jackett.Common/Indexers/HDSpace.cs index 0a9344ba4..b15d558a4 100644 --- a/src/Jackett.Common/Indexers/HDSpace.cs +++ b/src/Jackett.Common/Indexers/HDSpace.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -128,7 +128,8 @@ namespace Jackett.Common.Indexers { // this tracker has horrible markup, find the result rows by looking for the style tag before each one var prev = row.PreviousElementSibling; - if (prev == null || prev.NodeName.ToLowerInvariant() != "style") continue; + if (prev == null || prev.NodeName.ToLowerInvariant() != "style") + continue; CQ qRow = row.Cq(); var release = new ReleaseInfo(); diff --git a/src/Jackett.Common/Indexers/HDTorrents.cs b/src/Jackett.Common/Indexers/HDTorrents.cs index a75ce8521..88d49b54c 100644 --- a/src/Jackett.Common/Indexers/HDTorrents.cs +++ b/src/Jackett.Common/Indexers/HDTorrents.cs @@ -157,11 +157,13 @@ namespace Jackett.Common.Indexers release.MinimumRatio = 1; release.MinimumSeedTime = 172800; // 48 hours - + int tdIndex = 0; - if(qRow.Find("td:nth-last-child(1)").Text() == "Edit") tdIndex = 1; + if (qRow.Find("td:nth-last-child(1)").Text() == "Edit") + tdIndex = 1; // moderators get additional delete, recomend and like links - if (qRow.Find("td:nth-last-child(4)").Text() == "Edit") tdIndex = 4; + if (qRow.Find("td:nth-last-child(4)").Text() == "Edit") + tdIndex = 4; // Sometimes the uploader column is missing if (ParseUtil.TryCoerceInt(qRow.Find($"td:nth-last-child({tdIndex + 3})").Text(), out int seeders)) @@ -200,7 +202,7 @@ namespace Jackett.Common.Indexers release.DownloadVolumeFactor = 0; release.UploadVolumeFactor = 0; } - else if(hasFreeleech) + else if (hasFreeleech) release.DownloadVolumeFactor = 0; else if (qRow.Find("img[alt=\"Silver Torrent\"]").Length >= 1) release.DownloadVolumeFactor = 0.5; diff --git a/src/Jackett.Common/Indexers/Hebits.cs b/src/Jackett.Common/Indexers/Hebits.cs index 0a5dd9d21..61cd9e443 100644 --- a/src/Jackett.Common/Indexers/Hebits.cs +++ b/src/Jackett.Common/Indexers/Hebits.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Text; diff --git a/src/Jackett.Common/Indexers/HorribleSubs.cs b/src/Jackett.Common/Indexers/HorribleSubs.cs index ff38c02bb..02b053617 100644 --- a/src/Jackett.Common/Indexers/HorribleSubs.cs +++ b/src/Jackett.Common/Indexers/HorribleSubs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -170,7 +170,7 @@ namespace Jackett.Common.Indexers foreach (string apiUrl in apiUrls) { int nextId = 0; - while(true) + while (true) { var showAPIResponse = await RequestStringWithCookiesAndRetry(apiUrl + "&nextid=" + nextId, string.Empty); var showAPIdom = ResultParser.ParseDocument(showAPIResponse.Content); @@ -178,7 +178,8 @@ namespace Jackett.Common.Indexers releaserows.AddRange(releaseRowResults); nextId++; - if (releaseRowResults.Length == 0 || latestOnly) { + if (releaseRowResults.Length == 0 || latestOnly) + { break; } } diff --git a/src/Jackett.Common/Indexers/IIndexer.cs b/src/Jackett.Common/Indexers/IIndexer.cs index 472ac8357..6d9e2e5dc 100644 --- a/src/Jackett.Common/Indexers/IIndexer.cs +++ b/src/Jackett.Common/Indexers/IIndexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; diff --git a/src/Jackett.Common/Indexers/IPTorrents.cs b/src/Jackett.Common/Indexers/IPTorrents.cs index 47e80da60..7352503ae 100644 --- a/src/Jackett.Common/Indexers/IPTorrents.cs +++ b/src/Jackett.Common/Indexers/IPTorrents.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; @@ -159,11 +159,11 @@ namespace Jackett.Common.Indexers { var result = new ConfigurationDataBasicLogin { - SiteLink = {Value = configData.SiteLink.Value}, - Instructions = {Value = configData.Instructions.Value}, - Username = {Value = configData.Username.Value}, - Password = {Value = configData.Password.Value}, - CookieHeader = {Value = loginPage.Cookies} + SiteLink = { Value = configData.SiteLink.Value }, + Instructions = { Value = configData.Instructions.Value }, + Username = { Value = configData.Username.Value }, + Password = { Value = configData.Password.Value }, + CookieHeader = { Value = loginPage.Cookies } }; return result; } @@ -258,7 +258,7 @@ namespace Jackett.Common.Indexers var release = new ReleaseInfo(); var qRow = row.Cq(); var qTitleLink = qRow.Find("a[href^=\"/details.php?id=\"]").First(); - // drop invalid char that seems to have cropped up in some titles. #6582 + // drop invalid char that seems to have cropped up in some titles. #6582 release.Title = qTitleLink.Text().Trim().Replace("\u000f", ""); // If we search an get no results, we still get a table just with no info. @@ -270,7 +270,7 @@ namespace Jackett.Common.Indexers var descString = qRow.Find(".t_ctime").Text(); var dateString = descString.Split('|').Last().Trim(); - dateString = dateString.Split(new [] { " by " }, StringSplitOptions.None)[0]; + dateString = dateString.Split(new[] { " by " }, StringSplitOptions.None)[0]; release.PublishDate = DateTimeUtil.FromTimeAgo(dateString); var qLink = row.ChildElements.ElementAt(3).Cq().Children("a"); diff --git a/src/Jackett.Common/Indexers/ImmortalSeed.cs b/src/Jackett.Common/Indexers/ImmortalSeed.cs index 60ea1dbe4..da6a73679 100644 --- a/src/Jackett.Common/Indexers/ImmortalSeed.cs +++ b/src/Jackett.Common/Indexers/ImmortalSeed.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/Jackett.Common/Indexers/InternetArchive.cs b/src/Jackett.Common/Indexers/InternetArchive.cs index 03cbf6525..95f9dcc67 100644 --- a/src/Jackett.Common/Indexers/InternetArchive.cs +++ b/src/Jackett.Common/Indexers/InternetArchive.cs @@ -58,14 +58,16 @@ namespace Jackett.Common.Indexers {"publicdate", "created"}, {"downloads", "downloads"}, {"item_size", "size"} - }) {Name = "Sort requested from site", Value = "publicdate"}; + }) + { Name = "Sort requested from site", Value = "publicdate" }; configData.AddDynamic("sort", sort); var order = new SelectItem(new Dictionary { {"desc", "desc"}, {"asc", "asc"}, - }) {Name = "Order requested from site", Value = "desc"}; + }) + { Name = "Order requested from site", Value = "desc" }; configData.AddDynamic("order", order); var titleOnly = new BoolItem() { Name = "Search only in title", Value = true }; @@ -99,10 +101,10 @@ namespace Jackett.Common.Indexers { base.LoadValuesFromJson(jsonConfig, useProtectionService); - var sort = (SelectItem) configData.GetDynamic("sort"); + var sort = (SelectItem)configData.GetDynamic("sort"); _sort = sort != null ? sort.Value : "publicdate"; - var order = (SelectItem) configData.GetDynamic("order"); + var order = (SelectItem)configData.GetDynamic("order"); _order = order != null && order.Value.Equals("asc") ? "" : "-"; var titleOnly = (BoolItem)configData.GetDynamic("titleOnly"); @@ -125,7 +127,7 @@ namespace Jackett.Common.Indexers } var querycats = MapTorznabCapsToTrackers(query); if (querycats.Any()) - searchTerm += " AND mediatype:(" + string.Join( " OR ", querycats) + ")"; + searchTerm += " AND mediatype:(" + string.Join(" OR ", querycats) + ")"; var qc = new NameValueCollection { @@ -166,7 +168,7 @@ namespace Jackett.Common.Indexers { var release = new ReleaseInfo(); - var id = (string) torrent["identifier"]; + var id = (string)torrent["identifier"]; var title = torrent["title"] is JArray ? (string)((JArray)torrent["title"])[0] : (string)torrent["title"]; diff --git a/src/Jackett.Common/Indexers/LostFilm.cs b/src/Jackett.Common/Indexers/LostFilm.cs index 23c9edb3b..76949cd6f 100644 --- a/src/Jackett.Common/Indexers/LostFilm.cs +++ b/src/Jackett.Common/Indexers/LostFilm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/MejorTorrent.cs b/src/Jackett.Common/Indexers/MejorTorrent.cs index e2e1c85eb..eb5e7c1d0 100644 --- a/src/Jackett.Common/Indexers/MejorTorrent.cs +++ b/src/Jackett.Common/Indexers/MejorTorrent.cs @@ -86,7 +86,7 @@ namespace Jackett.Common.Indexers // we remove parts from the original query query = ParseQuery(query); - var releases = string.IsNullOrEmpty(query.SearchTerm) ? + var releases = string.IsNullOrEmpty(query.SearchTerm) ? await PerformQueryNewest(query) : await PerformQuerySearch(query, matchWords); @@ -111,8 +111,8 @@ namespace Jackett.Common.Indexers searchResultParser = new HtmlParser(); html = searchResultParser.ParseDocument(result.Content); var onclick = html.QuerySelector("a[onclick*=\"/uploads/\"]").GetAttribute("onclick"); - var table = onclick.Split(new[] {"table: '"}, StringSplitOptions.None)[1].Split(new [] {"'"}, StringSplitOptions.None)[0]; - var name = onclick.Split(new[] {"name: '"}, StringSplitOptions.None)[1].Split(new [] {"'"}, StringSplitOptions.None)[0]; + var table = onclick.Split(new[] { "table: '" }, StringSplitOptions.None)[1].Split(new[] { "'" }, StringSplitOptions.None)[0]; + var name = onclick.Split(new[] { "name: '" }, StringSplitOptions.None)[1].Split(new[] { "'" }, StringSplitOptions.None)[0]; downloadUrl = SiteLink + "uploads/torrents/" + table + "/" + name; // Eg https://www.mejortorrentt.org/uploads/torrents/peliculas/Harry_Potter_1_y_la_Piedra_Filosofal_MicroHD_1080p.torrent @@ -158,9 +158,9 @@ namespace Jackett.Common.Indexers { // we add parsed items to parsedCommentsLink to avoid duplicates in newest torrents // list results - if(!parsedCommentsLink.Contains(rowCommentsLink)) + if (!parsedCommentsLink.Contains(rowCommentsLink)) { - await ParseRelease(releases, rowTitle, rowCommentsLink, null, + await ParseRelease(releases, rowTitle, rowCommentsLink, null, rowPublishDate, rowQuality, query, false); parsedCommentsLink.Add(rowCommentsLink); } @@ -186,7 +186,7 @@ namespace Jackett.Common.Indexers var releases = new List(); // search only the longest word, we filter the results later var searchTerm = GetLongestWord(query.SearchTerm); - var qc = new NameValueCollection {{"sec", "buscador"}, {"valor", searchTerm}}; + var qc = new NameValueCollection { { "sec", "buscador" }, { "valor", searchTerm } }; var url = SiteLink + SearchUrl + "?" + qc.GetQueryString(); var result = await RequestStringWithCookies(url); if (result.Status != HttpStatusCode.OK) @@ -216,7 +216,7 @@ namespace Jackett.Common.Indexers if (row.QuerySelector("td span") != null) rowQuality = row.QuerySelector("td span").TextContent; - await ParseRelease(releases, rowTitle, rowCommentsLink, rowMejortorrentCat, + await ParseRelease(releases, rowTitle, rowCommentsLink, rowMejortorrentCat, null, rowQuality, query, matchWords); } } @@ -254,7 +254,8 @@ namespace Jackett.Common.Indexers if (cat == MejorTorrentCatType.Serie || cat == MejorTorrentCatType.SerieHd) { await ParseSeriesRelease(releases, query, title, commentsLink, cat, publishDate); - } else if (query.Episode == null) // if it's scene series, we don't return other categories + } + else if (query.Episode == null) // if it's scene series, we don't return other categories { if (cat == MejorTorrentCatType.Pelicula) ParseMovieRelease(releases, query, title, commentsLink, cat, publishDate, quality); @@ -397,13 +398,13 @@ namespace Jackett.Common.Indexers // this code split the words, remove words with 2 letters or less, remove accents and lowercase var queryMatches = Regex.Matches(queryStr, @"\b[\w']*\b"); var queryWords = from m in queryMatches.Cast() - where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 - select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); + where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 + select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); var titleMatches = Regex.Matches(title, @"\b[\w']*\b"); var titleWords = from m in titleMatches.Cast() - where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 - select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); + where !string.IsNullOrEmpty(m.Value) && m.Value.Length > 2 + select Encoding.UTF8.GetString(Encoding.GetEncoding("ISO-8859-8").GetBytes(m.Value.ToLower())); titleWords = titleWords.ToArray(); return queryWords.All(word => titleWords.Contains(word)); @@ -449,7 +450,7 @@ namespace Jackett.Common.Indexers // title = The Mandalorian - 1ª Temporada // title = The Mandalorian - 1ª Temporada [720p] // title = Grace and Frankie - 5ª Temporada [720p]: 5x08 al 5x13. - var newTitle = title.Split(new [] { " - " }, StringSplitOptions.RemoveEmptyEntries)[0].Trim(); + var newTitle = title.Split(new[] { " - " }, StringSplitOptions.RemoveEmptyEntries)[0].Trim(); // newTitle = The Mandalorian // parse episode title @@ -464,7 +465,7 @@ namespace Jackett.Common.Indexers { if (newEpisodeTitle.Equals("")) { - newEpisodeTitle += "S" + m.Groups[1].Value.PadLeft(2, '0') + newEpisodeTitle += "S" + m.Groups[1].Value.PadLeft(2, '0') + "E" + m.Groups[2].Value.PadLeft(2, '0'); } else @@ -494,7 +495,7 @@ namespace Jackett.Common.Indexers m = Regex.Match(newEpisodeTitle, "^([0-9]+)x([0-9]+)(.*)$", RegexOptions.IgnoreCase); if (m.Success) { - newEpisodeTitle = "S" + m.Groups[1].Value.PadLeft(2, '0') + newEpisodeTitle = "S" + m.Groups[1].Value.PadLeft(2, '0') + "E" + m.Groups[2].Value.PadLeft(2, '0'); // newEpisodeTitle = S01E02 if (!m.Groups[3].Value.Equals("")) @@ -510,7 +511,7 @@ namespace Jackett.Common.Indexers newTitle += year + " " + newEpisodeTitle; // add quality - if (title.ToLower().Contains("[720p]")) + if (title.ToLower().Contains("[720p]")) newTitle += " SPANISH 720p HDTV x264"; else newTitle += " SPANISH SDTV XviD"; @@ -552,7 +553,7 @@ namespace Jackett.Common.Indexers if (!words.Any()) return null; var longestWord = words.First(); - foreach(var word in words) + foreach (var word in words) { if (word.Length >= longestWord.Length) longestWord = word; diff --git a/src/Jackett.Common/Indexers/Meta/BaseMetaIndexer.cs b/src/Jackett.Common/Indexers/Meta/BaseMetaIndexer.cs index fd3c7ebe3..885d3ed64 100644 --- a/src/Jackett.Common/Indexers/Meta/BaseMetaIndexer.cs +++ b/src/Jackett.Common/Indexers/Meta/BaseMetaIndexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Jackett.Common/Indexers/Meta/Fallbacks.cs b/src/Jackett.Common/Indexers/Meta/Fallbacks.cs index 163c3bb7b..bd647ec6a 100644 --- a/src/Jackett.Common/Indexers/Meta/Fallbacks.cs +++ b/src/Jackett.Common/Indexers/Meta/Fallbacks.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Jackett.Common.Models; diff --git a/src/Jackett.Common/Indexers/Meta/MetaIndexers.cs b/src/Jackett.Common/Indexers/Meta/MetaIndexers.cs index fdffe33ad..420a7ec2c 100644 --- a/src/Jackett.Common/Indexers/Meta/MetaIndexers.cs +++ b/src/Jackett.Common/Indexers/Meta/MetaIndexers.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Models; +using Jackett.Common.Models; using Jackett.Common.Models.IndexerConfig; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; @@ -31,4 +31,4 @@ namespace Jackett.Common.Indexers.Meta } } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/Meta/ResultFilters.cs b/src/Jackett.Common/Indexers/Meta/ResultFilters.cs index 7f78f17f9..d4729c111 100644 --- a/src/Jackett.Common/Indexers/Meta/ResultFilters.cs +++ b/src/Jackett.Common/Indexers/Meta/ResultFilters.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -29,20 +29,26 @@ namespace Jackett.Common.Indexers.Meta public async Task> FilterResults(IEnumerable results) { long? imdbId = null; - try { + try + { var normalizedImdbId = String.Concat(query.ImdbID.Where(c => char.IsDigit(c))); imdbId = Int64.Parse(normalizedImdbId); - } catch { + } + catch + { } IEnumerable perfectResults; IEnumerable wrongResults; - if (imdbId != null) { + if (imdbId != null) + { var resultsWithImdbId = results.Where(r => r.Imdb != null); wrongResults = resultsWithImdbId.Where(r => r.Imdb != imdbId); perfectResults = resultsWithImdbId.Where(r => r.Imdb == imdbId); - } else { + } + else + { wrongResults = new ReleaseInfo[] { }; perfectResults = new ReleaseInfo[] { }; } @@ -53,7 +59,8 @@ namespace Jackett.Common.Indexers.Meta var strippedTitles = titles.Select(t => RemoveSpecialChars(t)); var normalizedTitles = strippedTitles.SelectMany(t => GenerateTitleVariants(t)); - var titleFilteredResults = remainingResults.Where(r => { + var titleFilteredResults = remainingResults.Where(r => + { // TODO Make it possible to configure case insensitivity var containsAnyTitle = normalizedTitles.Select(t => r.Title.ToLowerInvariant().Contains(t.ToLowerInvariant())); var isProbablyValidResult = containsAnyTitle.Any(b => b); diff --git a/src/Jackett.Common/Indexers/MoreThanTV.cs b/src/Jackett.Common/Indexers/MoreThanTV.cs index 134008fe6..1acf8680f 100644 --- a/src/Jackett.Common/Indexers/MoreThanTV.cs +++ b/src/Jackett.Common/Indexers/MoreThanTV.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -141,10 +141,12 @@ namespace Jackett.Common.Indexers { var groupItem = previousElement.NextElementSibling; - if (groupItem == null) break; + if (groupItem == null) + break; if (!groupItem.ClassList[0].Equals("group_torrent") || - !groupItem.ClassList[1].StartsWith("groupid_")) break; + !groupItem.ClassList[1].StartsWith("groupid_")) + break; // Found a new edition if (groupItem.ClassList[2].Equals("edition")) @@ -153,7 +155,8 @@ namespace Jackett.Common.Indexers } else if (groupItem.ClassList[2].StartsWith("edition_")) { - if (qualityEdition.Equals(string.Empty)) break; + if (qualityEdition.Equals(string.Empty)) + break; // Parse required data var downloadAnchor = groupItem.QuerySelectorAll("td a").Last(); diff --git a/src/Jackett.Common/Indexers/MyAnonamouse.cs b/src/Jackett.Common/Indexers/MyAnonamouse.cs index b98c62533..31fc93b65 100644 --- a/src/Jackett.Common/Indexers/MyAnonamouse.cs +++ b/src/Jackett.Common/Indexers/MyAnonamouse.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -190,7 +190,7 @@ namespace Jackett.Common.Indexers int index = 0; foreach (string cat in catList) { - qParams.Add("tor[cat]["+index+"]", cat); + qParams.Add("tor[cat][" + index + "]", cat); index++; } } @@ -217,7 +217,7 @@ namespace Jackett.Common.Indexers var sitelink = new Uri(SiteLink); var error = jsonContent.Value("error"); - if(error != null) + if (error != null) { if (error == "Nothing returned, out of 0") return releases; @@ -226,7 +226,7 @@ namespace Jackett.Common.Indexers foreach (var item in jsonContent.Value("data")) { var release = new ReleaseInfo(); - + var id = item.Value("id"); release.Title = item.Value("title"); @@ -274,7 +274,7 @@ namespace Jackett.Common.Indexers var size = item.Value("size"); release.Size = ReleaseInfo.GetBytes(size); var free = item.Value("free"); - + if (free == 1) release.DownloadVolumeFactor = 0; else diff --git a/src/Jackett.Common/Indexers/NCore.cs b/src/Jackett.Common/Indexers/NCore.cs index fb6cd07d7..f3f11254a 100644 --- a/src/Jackett.Common/Indexers/NCore.cs +++ b/src/Jackett.Common/Indexers/NCore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -128,8 +128,8 @@ namespace Jackett.Common.Indexers var rows = dom[".box_torrent_all"].Find(".box_torrent"); // Check torrents only till we reach the query Limit - for(int i= previously_parsed_on_page; (i", " "), CultureInfo.InvariantCulture); + release.PublishDate = DateTime.Parse(qRow.Find(".box_feltoltve2").Get(0).InnerHTML.Replace("
", " "), CultureInfo.InvariantCulture); string[] sizeSplit = qRow.Find(".box_meret2").Get(0).InnerText.Split(' '); release.Size = ReleaseInfo.GetBytes(sizeSplit[1].ToLower(), ParseUtil.CoerceFloat(sizeSplit[0])); string catlink = qRow.Find("a:has(img[class='categ_link'])").First().Attr("href"); @@ -215,7 +216,7 @@ namespace Jackett.Common.Indexers } } catch (FormatException ex) - { + { logger.Error("Problem of parsing Torrent:" + rows[i].InnerHTML); logger.Error("Exception was the following:" + ex); } @@ -267,16 +268,16 @@ namespace Jackett.Common.Indexers } var results = await PostDataWithCookiesAndRetry(SearchUrl, pairs); - + CQ dom = results.Content; int numVal = 0; // find number of torrents / page int torrent_per_page = dom[".box_torrent_all"].Find(".box_torrent").Length; - if (torrent_per_page==0) + if (torrent_per_page == 0) return releases; - int start_page = (query.Offset / torrent_per_page)+1; + int start_page = (query.Offset / torrent_per_page) + 1; int previously_parsed_on_page = query.Offset - (start_page * torrent_per_page) + 1; //+1 because indexing start from 0 if (previously_parsed_on_page < 0) previously_parsed_on_page = query.Offset; @@ -286,7 +287,7 @@ namespace Jackett.Common.Indexers if (pagelinks.Length > 0) { // If there are several pages find the link for the latest one - for (int i= pagelinks.Length - 1; i > 0; i--) + for (int i = pagelinks.Length - 1; i > 0; i--) { var last_page_link = (pagelinks[i].Cq().Attr("href")).Trim(); if (last_page_link.Contains("oldal")) @@ -296,7 +297,7 @@ namespace Jackett.Common.Indexers break; } } - } + } var limit = query.Limit; if (limit == 0) @@ -308,11 +309,11 @@ namespace Jackett.Common.Indexers previously_parsed_on_page = 0; start_page++; } - + // Check all the pages for the torrents. // The starting index is 2. (the first one is the original where we parse out the pages.) - for (int i= start_page; (i<= numVal && releases.Count < limit); i++ ) + for (int i = start_page; (i <= numVal && releases.Count < limit); i++) { pairs.Add(new KeyValuePair("oldal", i.ToString())); results = await PostDataWithCookiesAndRetry(SearchUrl, pairs); @@ -327,9 +328,9 @@ namespace Jackett.Common.Indexers protected override async Task> PerformQuery(TorznabQuery query) { var results = await PerformQuery(query, null); - if (results.Count()==0 && query.IsTVSearch) // if we search for a localized title ncore can't handle any extra S/E information, search without it and AND filter the results. See #1450 + if (results.Count() == 0 && query.IsTVSearch) // if we search for a localized title ncore can't handle any extra S/E information, search without it and AND filter the results. See #1450 { - results = await PerformQuery(query,query.GetEpisodeSearchString()); + results = await PerformQuery(query, query.GetEpisodeSearchString()); } return results; diff --git a/src/Jackett.Common/Indexers/NewRealWorld.cs b/src/Jackett.Common/Indexers/NewRealWorld.cs index fa35f27f5..6fcd394b6 100644 --- a/src/Jackett.Common/Indexers/NewRealWorld.cs +++ b/src/Jackett.Common/Indexers/NewRealWorld.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -43,8 +43,8 @@ namespace Jackett.Common.Indexers AddCategoryMapping(39, TorznabCatType.TVAnime); // Anime: HD|1080p AddCategoryMapping(38, TorznabCatType.TVAnime); // Anime: HD|720p - AddCategoryMapping(1, TorznabCatType.TVAnime); // Anime: SD - AddCategoryMapping(7, TorznabCatType.PCPhoneOther); // Appz: Handy-PDA + AddCategoryMapping(1, TorznabCatType.TVAnime); // Anime: SD + AddCategoryMapping(7, TorznabCatType.PCPhoneOther); // Appz: Handy-PDA AddCategoryMapping(36, TorznabCatType.PCMac); // Appz: Mac AddCategoryMapping(18, TorznabCatType.PC); // Appz: Sonstiges AddCategoryMapping(17, TorznabCatType.PC); // Appz: Win @@ -55,8 +55,8 @@ namespace Jackett.Common.Indexers AddCategoryMapping(22, TorznabCatType.AudioVideo); // Audio: Videoclip AddCategoryMapping(19, TorznabCatType.Other); // Diverses: Sonstiges AddCategoryMapping(43, TorznabCatType.TVDocumentary); // Dokus: HD - AddCategoryMapping(2, TorznabCatType.TVDocumentary); // Dokus: SD - AddCategoryMapping(3, TorznabCatType.Books); // Ebooks: Bücher + AddCategoryMapping(2, TorznabCatType.TVDocumentary); // Dokus: SD + AddCategoryMapping(3, TorznabCatType.Books); // Ebooks: Bücher AddCategoryMapping(52, TorznabCatType.BooksComics); // Ebooks: Comics AddCategoryMapping(53, TorznabCatType.BooksMagazines); // Ebooks: Magazine AddCategoryMapping(55, TorznabCatType.BooksOther); // Ebooks: XXX @@ -64,10 +64,10 @@ namespace Jackett.Common.Indexers AddCategoryMapping(47, TorznabCatType.PCPhoneOther); // Games: Andere AddCategoryMapping(32, TorznabCatType.PCMac); // Games: Mac AddCategoryMapping(41, TorznabCatType.ConsoleNDS); // Games: NDS/3DS - AddCategoryMapping(4, TorznabCatType.PCGames); // Games: PC - AddCategoryMapping(5, TorznabCatType.ConsolePS3); // Games: PS2 - AddCategoryMapping(9, TorznabCatType.ConsolePS3); // Games: PS3 - AddCategoryMapping(6, TorznabCatType.ConsolePSP); // Games: PSP + AddCategoryMapping(4, TorznabCatType.PCGames); // Games: PC + AddCategoryMapping(5, TorznabCatType.ConsolePS3); // Games: PS2 + AddCategoryMapping(9, TorznabCatType.ConsolePS3); // Games: PS3 + AddCategoryMapping(6, TorznabCatType.ConsolePSP); // Games: PSP AddCategoryMapping(28, TorznabCatType.ConsoleWii); // Games: Wii AddCategoryMapping(31, TorznabCatType.ConsoleXbox); // Games: XboX AddCategoryMapping(51, TorznabCatType.Movies3D); // Movies: 3D @@ -75,7 +75,7 @@ namespace Jackett.Common.Indexers AddCategoryMapping(25, TorznabCatType.MoviesHD); // Movies: HD|1080p AddCategoryMapping(29, TorznabCatType.MoviesHD); // Movies: HD|720p AddCategoryMapping(11, TorznabCatType.MoviesDVD); // Movies: SD|DVD-R - AddCategoryMapping(8, TorznabCatType.MoviesSD); // Movies: SD|x264 + AddCategoryMapping(8, TorznabCatType.MoviesSD); // Movies: SD|x264 AddCategoryMapping(13, TorznabCatType.MoviesSD); // Movies: SD|XviD AddCategoryMapping(40, TorznabCatType.MoviesForeign); // Movies: US Movies AddCategoryMapping(33, TorznabCatType.TV); // Serien: DVD-R diff --git a/src/Jackett.Common/Indexers/Newpct.cs b/src/Jackett.Common/Indexers/Newpct.cs index 9a8fc4879..fe13d8192 100644 --- a/src/Jackett.Common/Indexers/Newpct.cs +++ b/src/Jackett.Common/Indexers/Newpct.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/Norbits.cs b/src/Jackett.Common/Indexers/Norbits.cs index a2a38120e..9fcac128c 100644 --- a/src/Jackett.Common/Indexers/Norbits.cs +++ b/src/Jackett.Common/Indexers/Norbits.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/Nordicbits.cs b/src/Jackett.Common/Indexers/Nordicbits.cs index d2090fbba..604a4f364 100644 --- a/src/Jackett.Common/Indexers/Nordicbits.cs +++ b/src/Jackett.Common/Indexers/Nordicbits.cs @@ -295,7 +295,7 @@ namespace Jackett.Common.Indexers // Getting results & Store content var response = await RequestStringWithCookiesAndRetry(request, ConfigData.CookieHeader.Value); _fDom = response.Content; - + try { var firstPageRows = FindTorrentRows(); @@ -329,11 +329,11 @@ namespace Jackett.Common.Indexers } Output("\nFound " + nbResults + " result(s) (+/- " + firstPageRows.Length + ") in " + pageLinkCount + " page(s) for this query !"); - Output("\nThere are " + (firstPageRows.Length -2 ) + " results on the first page !"); + Output("\nThere are " + (firstPageRows.Length - 2) + " results on the first page !"); // Loop on results - foreach (var tRow in torrentRowList.Skip(1).Take(torrentRowList.Count-2)) + foreach (var tRow in torrentRowList.Skip(1).Take(torrentRowList.Count - 2)) { Output("Torrent #" + (releases.Count + 1)); diff --git a/src/Jackett.Common/Indexers/Orpheus.cs b/src/Jackett.Common/Indexers/Orpheus.cs index 492a028de..d4b4db3e0 100644 --- a/src/Jackett.Common/Indexers/Orpheus.cs +++ b/src/Jackett.Common/Indexers/Orpheus.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; diff --git a/src/Jackett.Common/Indexers/PassThePopcorn.cs b/src/Jackett.Common/Indexers/PassThePopcorn.cs index 2d3af86a5..5e569c968 100644 --- a/src/Jackett.Common/Indexers/PassThePopcorn.cs +++ b/src/Jackett.Common/Indexers/PassThePopcorn.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -108,7 +108,7 @@ namespace Jackett.Common.Indexers queryCollection.Add("searchstr", query.GetQueryString()); } - if(configFreeOnly) + if (configFreeOnly) queryCollection.Add("freetorrent", "1"); if (queryCollection.Count > 0) diff --git a/src/Jackett.Common/Indexers/PiXELHD.cs b/src/Jackett.Common/Indexers/PiXELHD.cs index 16de2692f..819674039 100644 --- a/src/Jackett.Common/Indexers/PiXELHD.cs +++ b/src/Jackett.Common/Indexers/PiXELHD.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; diff --git a/src/Jackett.Common/Indexers/PirateTheNet.cs b/src/Jackett.Common/Indexers/PirateTheNet.cs index fbacb25f5..088d251e4 100644 --- a/src/Jackett.Common/Indexers/PirateTheNet.cs +++ b/src/Jackett.Common/Indexers/PirateTheNet.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/PolishTracker.cs b/src/Jackett.Common/Indexers/PolishTracker.cs index b10c4a4e3..ee9029f0a 100644 --- a/src/Jackett.Common/Indexers/PolishTracker.cs +++ b/src/Jackett.Common/Indexers/PolishTracker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; @@ -40,7 +40,7 @@ namespace Jackett.Common.Indexers p: ps, configData: new ConfigurationDataBasicLoginWithEmail()) { -Encoding = Encoding.UTF8; + Encoding = Encoding.UTF8; Language = "pl-pl"; Type = "private"; diff --git a/src/Jackett.Common/Indexers/Pretome.cs b/src/Jackett.Common/Indexers/Pretome.cs index 28fc062c0..c186e950a 100644 --- a/src/Jackett.Common/Indexers/Pretome.cs +++ b/src/Jackett.Common/Indexers/Pretome.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; diff --git a/src/Jackett.Common/Indexers/PrivateHD.cs b/src/Jackett.Common/Indexers/PrivateHD.cs index fce100680..a851c91e1 100644 --- a/src/Jackett.Common/Indexers/PrivateHD.cs +++ b/src/Jackett.Common/Indexers/PrivateHD.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; using NLog; diff --git a/src/Jackett.Common/Indexers/Psytorrents.cs b/src/Jackett.Common/Indexers/Psytorrents.cs index ef9631636..5056766c5 100644 --- a/src/Jackett.Common/Indexers/Psytorrents.cs +++ b/src/Jackett.Common/Indexers/Psytorrents.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; diff --git a/src/Jackett.Common/Indexers/Rarbg.cs b/src/Jackett.Common/Indexers/Rarbg.cs index 5723dd84a..32b33e6a3 100644 --- a/src/Jackett.Common/Indexers/Rarbg.cs +++ b/src/Jackett.Common/Indexers/Rarbg.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -66,7 +66,8 @@ namespace Jackett.Common.Indexers {"last", "created"}, {"seeders", "seeders"}, {"leechers", "leechers"} - }) {Name = "Sort requested from site", Value = "last"}; + }) + { Name = "Sort requested from site", Value = "last" }; configData.AddDynamic("sort", sort); var provideTorrentLinkItem = new BoolItem { Value = false }; @@ -109,7 +110,7 @@ namespace Jackett.Common.Indexers { base.LoadValuesFromJson(jsonConfig, useProtectionService); - var sort = (SelectItem) configData.GetDynamic("sort"); + var sort = (SelectItem)configData.GetDynamic("sort"); _sort = sort != null ? sort.Value : "last"; var provideTorrentLinkItem = (BoolItem)configData.GetDynamic("providetorrentlink"); diff --git a/src/Jackett.Common/Indexers/Redacted.cs b/src/Jackett.Common/Indexers/Redacted.cs index a7d6405c1..00ddd9464 100644 --- a/src/Jackett.Common/Indexers/Redacted.cs +++ b/src/Jackett.Common/Indexers/Redacted.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; @@ -33,4 +33,4 @@ namespace Jackett.Common.Indexers AddCategoryMapping(7, TorznabCatType.Books, "Comics"); } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/SceneHD.cs b/src/Jackett.Common/Indexers/SceneHD.cs index a15cc387b..5da32f61b 100644 --- a/src/Jackett.Common/Indexers/SceneHD.cs +++ b/src/Jackett.Common/Indexers/SceneHD.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -95,14 +95,14 @@ namespace Jackett.Common.Indexers NameValueCollection qParams = new NameValueCollection(); qParams.Add("api", ""); - if(query.ImdbIDShort != null) + if (query.ImdbIDShort != null) qParams.Add("imdb", query.ImdbIDShort); else qParams.Add("search", query.SearchTerm); foreach (var cat in MapTorznabCapsToTrackers(query)) { - qParams.Add("categories["+cat+"]", "1"); + qParams.Add("categories[" + cat + "]", "1"); } string urlSearch = SearchUrl; @@ -147,7 +147,7 @@ namespace Jackett.Common.Indexers var size = item.Value("size"); release.Size = ReleaseInfo.GetBytes(size); var is_freeleech = item.Value("is_freeleech"); - + if (is_freeleech == 1) release.DownloadVolumeFactor = 0; else diff --git a/src/Jackett.Common/Indexers/SceneTime.cs b/src/Jackett.Common/Indexers/SceneTime.cs index 589b49ce8..522473bd5 100644 --- a/src/Jackett.Common/Indexers/SceneTime.cs +++ b/src/Jackett.Common/Indexers/SceneTime.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; diff --git a/src/Jackett.Common/Indexers/SecretCinema.cs b/src/Jackett.Common/Indexers/SecretCinema.cs index a8608bea2..20a28f973 100644 --- a/src/Jackett.Common/Indexers/SecretCinema.cs +++ b/src/Jackett.Common/Indexers/SecretCinema.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; @@ -61,4 +61,4 @@ namespace Jackett.Common.Indexers return true; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/Shazbat.cs b/src/Jackett.Common/Indexers/Shazbat.cs index 008558a77..098828a7e 100644 --- a/src/Jackett.Common/Indexers/Shazbat.cs +++ b/src/Jackett.Common/Indexers/Shazbat.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/Jackett.Common/Indexers/ShowRSS.cs b/src/Jackett.Common/Indexers/ShowRSS.cs index c3e3db7e8..7e0d0d7ea 100644 --- a/src/Jackett.Common/Indexers/ShowRSS.cs +++ b/src/Jackett.Common/Indexers/ShowRSS.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -118,4 +118,4 @@ namespace Jackett.Common.Indexers return releases; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/SpeedCD.cs b/src/Jackett.Common/Indexers/SpeedCD.cs index 990475c88..d12d033f1 100644 --- a/src/Jackett.Common/Indexers/SpeedCD.cs +++ b/src/Jackett.Common/Indexers/SpeedCD.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/Superbits.cs b/src/Jackett.Common/Indexers/Superbits.cs index 069ffc922..57ef6da39 100644 --- a/src/Jackett.Common/Indexers/Superbits.cs +++ b/src/Jackett.Common/Indexers/Superbits.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Jackett.Common/Indexers/TVVault.cs b/src/Jackett.Common/Indexers/TVVault.cs index c12db0755..3e06f992c 100644 --- a/src/Jackett.Common/Indexers/TVVault.cs +++ b/src/Jackett.Common/Indexers/TVVault.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; diff --git a/src/Jackett.Common/Indexers/TVstore.cs b/src/Jackett.Common/Indexers/TVstore.cs index 13bcd296f..9fce0429c 100755 --- a/src/Jackett.Common/Indexers/TVstore.cs +++ b/src/Jackett.Common/Indexers/TVstore.cs @@ -91,14 +91,19 @@ namespace Jackett.Common.Indexers /* In case of season Packs */ if (type.Equals("season")) { - if (dd >= 90) return 4; - if (dd >= 30) return 2; - if (dd >= 14) return 1.5; + if (dd >= 90) + return 4; + if (dd >= 30) + return 2; + if (dd >= 14) + return 1.5; } else /* In case of single episodes */ { - if (dd >= 60) return 2; - if (dd >= 30) return 1.5; + if (dd >= 60) + return 2; + if (dd >= 30) + return 1.5; } return 1; } @@ -339,7 +344,7 @@ namespace Jackett.Common.Indexers int previously_parsed_on_page = query.Offset - (start_page * torrent_per_page) + 1; //+1 because indexing start from 0 if (previously_parsed_on_page <= 0) previously_parsed_on_page = query.Offset; - + double pages = Math.Ceiling((double)max_found / (double)torrent_per_page); @@ -351,9 +356,9 @@ namespace Jackett.Common.Indexers start_page++; } - for (page =start_page; (page<=pages && releases.Count ApplyConfiguration(JToken configJson) { @@ -140,13 +140,15 @@ namespace Jackett.Common.Indexers queryCollection.Add("incldead", "1"); queryCollection.Add("rel_type", "0"); // Alle - if(query.ImdbID != null) + if (query.ImdbID != null) { queryCollection.Add("searchin", "imdb"); queryCollection.Add("search", query.ImdbID); - } else { + } + else + { queryCollection.Add("searchin", "title"); - + if (!string.IsNullOrWhiteSpace(searchString)) { // use AND+wildcard operator to avoid getting to many useless results @@ -154,7 +156,7 @@ namespace Jackett.Common.Indexers searchStringArray = searchStringArray.Select(x => "+" + x).ToList(); // add AND operators var searchStringFinal = String.Join(" ", searchStringArray); queryCollection.Add("search", searchStringFinal); - } + } } foreach (var cat in MapTorznabCapsToTrackers(query)) diff --git a/src/Jackett.Common/Indexers/Torrentech.cs b/src/Jackett.Common/Indexers/Torrentech.cs index c893f1b51..4996aa305 100644 --- a/src/Jackett.Common/Indexers/Torrentech.cs +++ b/src/Jackett.Common/Indexers/Torrentech.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; diff --git a/src/Jackett.Common/Indexers/Torrentscsv.cs b/src/Jackett.Common/Indexers/Torrentscsv.cs index 5dfdb388c..9c4e23be5 100644 --- a/src/Jackett.Common/Indexers/Torrentscsv.cs +++ b/src/Jackett.Common/Indexers/Torrentscsv.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -13,88 +13,99 @@ using Jackett.Common.Utils.Clients; using Newtonsoft.Json.Linq; using NLog; -namespace Jackett.Common.Indexers { - public class Torrentscsv : BaseWebIndexer { +namespace Jackett.Common.Indexers +{ + public class Torrentscsv : BaseWebIndexer + { private string ApiEndpoint { get { return SiteLink + "service/search"; } } - private new ConfigurationData configData { - get { return (ConfigurationData) base.configData; } + private new ConfigurationData configData + { + get { return (ConfigurationData)base.configData; } set { base.configData = value; } } - public Torrentscsv (IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps) : base ( + public Torrentscsv(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps) : base( name: "Torrents.csv", description: "Torrents.csv is a self-hostable, open source torrent search engine and database", link: "https://torrents-csv.ml/", - caps : new TorznabCapabilities (), - configService : configService, - client : wc, - logger : l, - p : ps, - configData : new ConfigurationData ()) { + caps: new TorznabCapabilities(), + configService: configService, + client: wc, + logger: l, + p: ps, + configData: new ConfigurationData()) + { Encoding = Encoding.UTF8; Language = "en-us"; Type = "public"; // dummy mappings for sonarr, radarr, etc since torrents.csv doesnt return categories - AddCategoryMapping (1000, TorznabCatType.Console); - AddCategoryMapping (2000, TorznabCatType.Movies); - AddCategoryMapping (3000, TorznabCatType.Audio); - AddCategoryMapping (4000, TorznabCatType.PC); - AddCategoryMapping (5000, TorznabCatType.TV); - AddCategoryMapping (6000, TorznabCatType.XXX); - AddCategoryMapping (7000, TorznabCatType.Other); - AddCategoryMapping (8000, TorznabCatType.Books); + AddCategoryMapping(1000, TorznabCatType.Console); + AddCategoryMapping(2000, TorznabCatType.Movies); + AddCategoryMapping(3000, TorznabCatType.Audio); + AddCategoryMapping(4000, TorznabCatType.PC); + AddCategoryMapping(5000, TorznabCatType.TV); + AddCategoryMapping(6000, TorznabCatType.XXX); + AddCategoryMapping(7000, TorznabCatType.Other); + AddCategoryMapping(8000, TorznabCatType.Books); TorznabCaps.SupportsImdbMovieSearch = false; webclient.requestDelay = 0; } - public override async Task ApplyConfiguration (JToken configJson) { - configData.LoadValuesFromJson (configJson); - var releases = await PerformQuery (new TorznabQuery ()); + public override async Task ApplyConfiguration(JToken configJson) + { + configData.LoadValuesFromJson(configJson); + var releases = await PerformQuery(new TorznabQuery()); - await ConfigureIfOK (string.Empty, releases.Count () > 0, () => { - throw new Exception ("Error: No data returned!"); + await ConfigureIfOK(string.Empty, releases.Count() > 0, () => + { + throw new Exception("Error: No data returned!"); }); return IndexerConfigurationStatus.Completed; } - protected override async Task> PerformQuery (TorznabQuery query) { - return await PerformQuery (query, 0); + protected override async Task> PerformQuery(TorznabQuery query) + { + return await PerformQuery(query, 0); } - public async Task> PerformQuery (TorznabQuery query, int attempts) { - var releases = new List (); - var searchString = query.GetQueryString (); - if (string.IsNullOrEmpty(searchString)) searchString = "%"; + public async Task> PerformQuery(TorznabQuery query, int attempts) + { + var releases = new List(); + var searchString = query.GetQueryString(); + if (string.IsNullOrEmpty(searchString)) + searchString = "%"; - var queryCollection = new NameValueCollection (); + var queryCollection = new NameValueCollection(); - queryCollection.Add ("q", searchString); - queryCollection.Add ("size", "500"); - queryCollection.Add ("type_", "torrent"); + queryCollection.Add("q", searchString); + queryCollection.Add("size", "500"); + queryCollection.Add("type_", "torrent"); - var searchUrl = ApiEndpoint + "?" + queryCollection.GetQueryString (); - var response = await RequestStringWithCookiesAndRetry (searchUrl, string.Empty); + var searchUrl = ApiEndpoint + "?" + queryCollection.GetQueryString(); + var response = await RequestStringWithCookiesAndRetry(searchUrl, string.Empty); - try { + try + { var jsonStart = response.Content; - var jsonContent = JArray.Parse (jsonStart); + var jsonContent = JArray.Parse(jsonStart); - foreach (var torrent in jsonContent) { - - if (torrent == null) - throw new Exception ("Error: No data returned!"); + foreach (var torrent in jsonContent) + { - var release = new ReleaseInfo (); - release.Title = torrent.Value ("name"); + if (torrent == null) + throw new Exception("Error: No data returned!"); + + var release = new ReleaseInfo(); + release.Title = torrent.Value("name"); // construct magnet link from infohash with all public trackers known to man - string magnet_uri = "magnet:?xt=urn:btih:" + torrent.Value ("infohash") + + string magnet_uri = "magnet:?xt=urn:btih:" + torrent.Value("infohash") + "&tr=udp://tracker.coppersurfer.tk:6969/announce" + "&tr=udp://tracker.leechers-paradise.org:6969/announce" + "&tr=udp://tracker.internetwarriors.net:1337/announce" + @@ -127,67 +138,80 @@ namespace Jackett.Common.Indexers { "&tr=udp://torrentclub.tech:6969/announce" + "&tr=udp://tracker.tvunderground.org.ru:3218/announce" + "&tr=udp://tracker.open-tracker.org:1337/announce" + - "&tr=udp://tracker.justseed.it:1337/announce"; + "&tr=udp://tracker.justseed.it:1337/announce"; - release.MagnetUri = new Uri (magnet_uri); + release.MagnetUri = new Uri(magnet_uri); // there is no comments or details link so we point to the web site instead - release.Comments = new Uri (SiteLink); + release.Comments = new Uri(SiteLink); release.Guid = release.MagnetUri; release.Link = release.MagnetUri; - release.InfoHash = torrent.Value ("infohash").ToString (); + release.InfoHash = torrent.Value("infohash").ToString(); // convert unix timestamp to human readable date - double createdunix = torrent.Value ("created_unix"); - System.DateTime dateTime = new System.DateTime (1970, 1, 1, 0, 0, 0, 0); - dateTime = dateTime.AddSeconds (createdunix); + double createdunix = torrent.Value("created_unix"); + System.DateTime dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0); + dateTime = dateTime.AddSeconds(createdunix); release.PublishDate = dateTime; - release.Seeders = torrent.Value ("seeders"); - release.Peers = torrent.Value ("leechers") + release.Seeders; - release.Size = torrent.Value ("size_bytes"); + release.Seeders = torrent.Value("seeders"); + release.Peers = torrent.Value("leechers") + release.Seeders; + release.Size = torrent.Value("size_bytes"); var grabs = torrent.Value("completed"); - if (grabs == null) grabs = "0"; + if (grabs == null) + grabs = "0"; release.Grabs = ParseUtil.CoerceInt(grabs); release.MinimumRatio = 1; release.MinimumSeedTime = 172800; // 48 hours release.DownloadVolumeFactor = 0; release.UploadVolumeFactor = 1; - // dummy mappings for sonarr, radarr, etc - string categories = string.Join (";", MapTorznabCapsToTrackers (query)); - if (!string.IsNullOrEmpty (categories)) { - if (categories.Contains ("1000")) { + // dummy mappings for sonarr, radarr, etc + string categories = string.Join(";", MapTorznabCapsToTrackers(query)); + if (!string.IsNullOrEmpty(categories)) + { + if (categories.Contains("1000")) + { release.Category = new List { TorznabCatType.Console.ID }; } - if (categories.Contains ("2000")) { + if (categories.Contains("2000")) + { release.Category = new List { TorznabCatType.Movies.ID }; } - if (categories.Contains ("3000")) { + if (categories.Contains("3000")) + { release.Category = new List { TorznabCatType.Audio.ID }; } - if (categories.Contains ("4000")) { + if (categories.Contains("4000")) + { release.Category = new List { TorznabCatType.PC.ID }; } - if (categories.Contains ("5000")) { + if (categories.Contains("5000")) + { release.Category = new List { TorznabCatType.TV.ID }; } - if (categories.Contains ("6000")) { + if (categories.Contains("6000")) + { release.Category = new List { TorznabCatType.XXX.ID }; } - if (categories.Contains ("7000")) { + if (categories.Contains("7000")) + { release.Category = new List { TorznabCatType.Other.ID }; } - if (categories.Contains ("8000")) { + if (categories.Contains("8000")) + { release.Category = new List { TorznabCatType.Books.ID }; } } // for null category - if (string.IsNullOrEmpty (categories)) { + if (string.IsNullOrEmpty(categories)) + { release.Category = new List { TorznabCatType.Other.ID }; } - releases.Add (release); + releases.Add(release); } - } catch (Exception ex) { - OnParseError (response.Content, ex); + } + catch (Exception ex) + { + OnParseError(response.Content, ex); } return releases; } diff --git a/src/Jackett.Common/Indexers/TransmitheNet.cs b/src/Jackett.Common/Indexers/TransmitheNet.cs index f5f9139e1..82e48d1ba 100644 --- a/src/Jackett.Common/Indexers/TransmitheNet.cs +++ b/src/Jackett.Common/Indexers/TransmitheNet.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Net; diff --git a/src/Jackett.Common/Indexers/XSpeeds.cs b/src/Jackett.Common/Indexers/XSpeeds.cs index aee9b39cd..8c3ba3a12 100644 --- a/src/Jackett.Common/Indexers/XSpeeds.cs +++ b/src/Jackett.Common/Indexers/XSpeeds.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/Jackett.Common/Indexers/Xthor.cs b/src/Jackett.Common/Indexers/Xthor.cs index b48dec40c..4c6e92e90 100644 --- a/src/Jackett.Common/Indexers/Xthor.cs +++ b/src/Jackett.Common/Indexers/Xthor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.IO; @@ -62,73 +62,73 @@ namespace Jackett.Common.Indexers TorznabCaps.Categories.Clear(); // Movies - AddCategoryMapping(118, TorznabCatType.MoviesBluRay, "UHD FULL BLURAY"); - AddCategoryMapping(119, TorznabCatType.MoviesBluRay, "UHD BLURAY REMUX"); - AddCategoryMapping(107, TorznabCatType.MoviesUHD, "UHD 2160P X265"); - AddCategoryMapping(1, TorznabCatType.MoviesBluRay, "FULL BLURAY"); - AddCategoryMapping(2, TorznabCatType.MoviesBluRay, "BLURAY REMUX"); - AddCategoryMapping(100, TorznabCatType.MoviesHD, "HD 1080P X265"); - AddCategoryMapping(4, TorznabCatType.MoviesHD, "HD 1080P X264"); - AddCategoryMapping(5, TorznabCatType.MoviesHD, "HD 720P X264"); - AddCategoryMapping(7, TorznabCatType.MoviesSD, "SD X264"); - AddCategoryMapping(8, TorznabCatType.MoviesDVD, "FULL DVD"); - AddCategoryMapping(3, TorznabCatType.Movies3D, "3D"); - AddCategoryMapping(6, TorznabCatType.MoviesSD, "XVID"); - AddCategoryMapping(122, TorznabCatType.MoviesHD, "HDTV"); - AddCategoryMapping(94, TorznabCatType.MoviesWEBDL, "WEBDL"); - AddCategoryMapping(95, TorznabCatType.MoviesWEBDL, "WEBRIP"); - AddCategoryMapping(12, TorznabCatType.TVDocumentary, "DOCS"); - AddCategoryMapping(33, TorznabCatType.MoviesOther, "SPECTACLE"); - AddCategoryMapping(31, TorznabCatType.MoviesOther, "ANIMATION"); - AddCategoryMapping(9, TorznabCatType.MoviesOther, "VOSTFR"); + AddCategoryMapping(118, TorznabCatType.MoviesBluRay, "UHD FULL BLURAY"); + AddCategoryMapping(119, TorznabCatType.MoviesBluRay, "UHD BLURAY REMUX"); + AddCategoryMapping(107, TorznabCatType.MoviesUHD, "UHD 2160P X265"); + AddCategoryMapping(1, TorznabCatType.MoviesBluRay, "FULL BLURAY"); + AddCategoryMapping(2, TorznabCatType.MoviesBluRay, "BLURAY REMUX"); + AddCategoryMapping(100, TorznabCatType.MoviesHD, "HD 1080P X265"); + AddCategoryMapping(4, TorznabCatType.MoviesHD, "HD 1080P X264"); + AddCategoryMapping(5, TorznabCatType.MoviesHD, "HD 720P X264"); + AddCategoryMapping(7, TorznabCatType.MoviesSD, "SD X264"); + AddCategoryMapping(8, TorznabCatType.MoviesDVD, "FULL DVD"); + AddCategoryMapping(3, TorznabCatType.Movies3D, "3D"); + AddCategoryMapping(6, TorznabCatType.MoviesSD, "XVID"); + AddCategoryMapping(122, TorznabCatType.MoviesHD, "HDTV"); + AddCategoryMapping(94, TorznabCatType.MoviesWEBDL, "WEBDL"); + AddCategoryMapping(95, TorznabCatType.MoviesWEBDL, "WEBRIP"); + AddCategoryMapping(12, TorznabCatType.TVDocumentary, "DOCS"); + AddCategoryMapping(33, TorznabCatType.MoviesOther, "SPECTACLE"); + AddCategoryMapping(31, TorznabCatType.MoviesOther, "ANIMATION"); + AddCategoryMapping(9, TorznabCatType.MoviesOther, "VOSTFR"); // Series - AddCategoryMapping(104, TorznabCatType.TVOTHER, "BLURAY"); - AddCategoryMapping(13, TorznabCatType.TVOTHER, "PACK VF"); - AddCategoryMapping(15, TorznabCatType.TVHD, "HD VF"); - AddCategoryMapping(14, TorznabCatType.TVSD, "SD VF"); - AddCategoryMapping(98, TorznabCatType.TVOTHER, "PACK VOSTFR"); - AddCategoryMapping(17, TorznabCatType.TVHD, "HD VF VOSTFR"); - AddCategoryMapping(16, TorznabCatType.TVSD, "SD VF VOSTFR"); - AddCategoryMapping(101, TorznabCatType.TVAnime, "PACK ANIME"); - AddCategoryMapping(32, TorznabCatType.TVAnime, "ANIME VF"); - AddCategoryMapping(110, TorznabCatType.TVAnime, "ANIME VOSTFR"); - AddCategoryMapping(123, TorznabCatType.TVOTHER, "ANIMATION"); - AddCategoryMapping(109, TorznabCatType.TVDocumentary, "DOCS"); - AddCategoryMapping(30, TorznabCatType.TVOTHER, "EMISSIONS"); - AddCategoryMapping(34, TorznabCatType.TVOTHER, "SPORT"); + AddCategoryMapping(104, TorznabCatType.TVOTHER, "BLURAY"); + AddCategoryMapping(13, TorznabCatType.TVOTHER, "PACK VF"); + AddCategoryMapping(15, TorznabCatType.TVHD, "HD VF"); + AddCategoryMapping(14, TorznabCatType.TVSD, "SD VF"); + AddCategoryMapping(98, TorznabCatType.TVOTHER, "PACK VOSTFR"); + AddCategoryMapping(17, TorznabCatType.TVHD, "HD VF VOSTFR"); + AddCategoryMapping(16, TorznabCatType.TVSD, "SD VF VOSTFR"); + AddCategoryMapping(101, TorznabCatType.TVAnime, "PACK ANIME"); + AddCategoryMapping(32, TorznabCatType.TVAnime, "ANIME VF"); + AddCategoryMapping(110, TorznabCatType.TVAnime, "ANIME VOSTFR"); + AddCategoryMapping(123, TorznabCatType.TVOTHER, "ANIMATION"); + AddCategoryMapping(109, TorznabCatType.TVDocumentary, "DOCS"); + AddCategoryMapping(30, TorznabCatType.TVOTHER, "EMISSIONS"); + AddCategoryMapping(34, TorznabCatType.TVOTHER, "SPORT"); // Music - AddCategoryMapping(20, TorznabCatType.AudioVideo, "CONCERT"); + AddCategoryMapping(20, TorznabCatType.AudioVideo, "CONCERT"); // Books - AddCategoryMapping(24, TorznabCatType.BooksEbook, "ENOOKS NOVEL"); - AddCategoryMapping(96, TorznabCatType.BooksMagazines, "EBOOKS MAGAZINES"); - AddCategoryMapping(116, TorznabCatType.BooksEbook, "EBOOKS NOVEL JUNIOR"); - AddCategoryMapping(99, TorznabCatType.BooksOther, "EBOOKS BD"); - AddCategoryMapping(102, TorznabCatType.BooksComics, "EBOOKS COMICS"); - AddCategoryMapping(103, TorznabCatType.BooksOther, "EBOOKS MANGA"); + AddCategoryMapping(24, TorznabCatType.BooksEbook, "ENOOKS NOVEL"); + AddCategoryMapping(96, TorznabCatType.BooksMagazines, "EBOOKS MAGAZINES"); + AddCategoryMapping(116, TorznabCatType.BooksEbook, "EBOOKS NOVEL JUNIOR"); + AddCategoryMapping(99, TorznabCatType.BooksOther, "EBOOKS BD"); + AddCategoryMapping(102, TorznabCatType.BooksComics, "EBOOKS COMICS"); + AddCategoryMapping(103, TorznabCatType.BooksOther, "EBOOKS MANGA"); // SOFTWARE - AddCategoryMapping(25, TorznabCatType.PCGames, "PC GAMES"); - AddCategoryMapping(27, TorznabCatType.ConsolePS3, "PS GAMES"); - AddCategoryMapping(111, TorznabCatType.PCMac, "MAC GAMES"); - AddCategoryMapping(112, TorznabCatType.PC, "LINUX GAMES"); - AddCategoryMapping(26, TorznabCatType.ConsoleXbox360, "XBOX GAMES"); - AddCategoryMapping(28, TorznabCatType.ConsoleWii, "WII GAMES"); - AddCategoryMapping(29, TorznabCatType.ConsoleNDS, "NDS GAMES"); - AddCategoryMapping(117, TorznabCatType.PC, "ROM"); - AddCategoryMapping(21, TorznabCatType.PC, "PC SOFTWARE"); - AddCategoryMapping(22, TorznabCatType.PCMac, "MAC SOFTWARE"); - AddCategoryMapping(23, TorznabCatType.PCPhoneAndroid, "ANDROID"); + AddCategoryMapping(25, TorznabCatType.PCGames, "PC GAMES"); + AddCategoryMapping(27, TorznabCatType.ConsolePS3, "PS GAMES"); + AddCategoryMapping(111, TorznabCatType.PCMac, "MAC GAMES"); + AddCategoryMapping(112, TorznabCatType.PC, "LINUX GAMES"); + AddCategoryMapping(26, TorznabCatType.ConsoleXbox360, "XBOX GAMES"); + AddCategoryMapping(28, TorznabCatType.ConsoleWii, "WII GAMES"); + AddCategoryMapping(29, TorznabCatType.ConsoleNDS, "NDS GAMES"); + AddCategoryMapping(117, TorznabCatType.PC, "ROM"); + AddCategoryMapping(21, TorznabCatType.PC, "PC SOFTWARE"); + AddCategoryMapping(22, TorznabCatType.PCMac, "MAC SOFTWARE"); + AddCategoryMapping(23, TorznabCatType.PCPhoneAndroid, "ANDROID"); // XxX - AddCategoryMapping(36, TorznabCatType.XXX, "XxX / Films"); - AddCategoryMapping(105, TorznabCatType.XXX, "XxX / Séries"); - AddCategoryMapping(114, TorznabCatType.XXX, "XxX / Lesbiennes"); - AddCategoryMapping(115, TorznabCatType.XXX, "XxX / Gays"); - AddCategoryMapping(113, TorznabCatType.XXX, "XxX / Hentai"); - AddCategoryMapping(120, TorznabCatType.XXX, "XxX / Magazines"); + AddCategoryMapping(36, TorznabCatType.XXX, "XxX / Films"); + AddCategoryMapping(105, TorznabCatType.XXX, "XxX / Séries"); + AddCategoryMapping(114, TorznabCatType.XXX, "XxX / Lesbiennes"); + AddCategoryMapping(115, TorznabCatType.XXX, "XxX / Gays"); + AddCategoryMapping(113, TorznabCatType.XXX, "XxX / Hentai"); + AddCategoryMapping(120, TorznabCatType.XXX, "XxX / Magazines"); } /// diff --git a/src/Jackett.Common/Indexers/cgpeers.cs b/src/Jackett.Common/Indexers/cgpeers.cs index 2f026b76e..2eedb701d 100644 --- a/src/Jackett.Common/Indexers/cgpeers.cs +++ b/src/Jackett.Common/Indexers/cgpeers.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; diff --git a/src/Jackett.Common/Indexers/digitalcore.cs b/src/Jackett.Common/Indexers/digitalcore.cs index fa6947b26..bf4e8cc72 100644 --- a/src/Jackett.Common/Indexers/digitalcore.cs +++ b/src/Jackett.Common/Indexers/digitalcore.cs @@ -73,7 +73,7 @@ namespace Jackett.Common.Indexers AddCategoryMapping(25, TorznabCatType.PCGames, "Games/PC"); AddCategoryMapping(26, TorznabCatType.Console, "Games/NSW"); AddCategoryMapping(27, TorznabCatType.PCMac, "Games/Mac"); - + AddCategoryMapping(28, TorznabCatType.Books, "Ebooks"); AddCategoryMapping(30, TorznabCatType.XXX, "XXX/SD"); @@ -205,7 +205,7 @@ namespace Jackett.Common.Indexers release.Description = string.Join("
\n", descriptions); - releases.Add(release); + releases.Add(release); } } diff --git a/src/Jackett.Common/Indexers/myAmity.cs b/src/Jackett.Common/Indexers/myAmity.cs index c6190faa8..ef92e297e 100644 --- a/src/Jackett.Common/Indexers/myAmity.cs +++ b/src/Jackett.Common/Indexers/myAmity.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -46,21 +46,21 @@ namespace Jackett.Common.Indexers AddCategoryMapping(22, TorznabCatType.Audio); // Audio - Musik AddCategoryMapping(52, TorznabCatType.Movies3D); // Filme - 3D AddCategoryMapping(51, TorznabCatType.MoviesBluRay); // Filme - BluRay Complete - AddCategoryMapping(1, TorznabCatType.MoviesDVD); // Filme - DVD + AddCategoryMapping(1, TorznabCatType.MoviesDVD); // Filme - DVD AddCategoryMapping(56, TorznabCatType.MoviesUHD); // Filme - UHD/4K AddCategoryMapping(54, TorznabCatType.MoviesHD); // Filme - HD/1080p - AddCategoryMapping(3, TorznabCatType.MoviesHD); // Filme - HD/720p + AddCategoryMapping(3, TorznabCatType.MoviesHD); // Filme - HD/720p AddCategoryMapping(48, TorznabCatType.XXX); // Filme - Heimatfilme.XXX AddCategoryMapping(50, TorznabCatType.Movies); // Filme - x264/H.264 - AddCategoryMapping(2, TorznabCatType.MoviesSD); // Filme - XViD + AddCategoryMapping(2, TorznabCatType.MoviesSD); // Filme - XViD AddCategoryMapping(11, TorznabCatType.Console); // Games - Konsolen AddCategoryMapping(10, TorznabCatType.PCGames); // Games - PC AddCategoryMapping(53, TorznabCatType.Other); // International - Complete AddCategoryMapping(36, TorznabCatType.Books); // Sonstige - E-Books AddCategoryMapping(38, TorznabCatType.Other); // Sonstige - Handy AddCategoryMapping(59, TorznabCatType.TVAnime); // Sonstige - Anime - AddCategoryMapping(7, TorznabCatType.TVDocumentary); // TV/HDTV - Dokus - AddCategoryMapping(8, TorznabCatType.TV); // TV/HDTV - Serien + AddCategoryMapping(7, TorznabCatType.TVDocumentary); // TV/HDTV - Dokus + AddCategoryMapping(8, TorznabCatType.TV); // TV/HDTV - Serien AddCategoryMapping(57, TorznabCatType.TVSport); // Sport - Allgemein } diff --git a/src/Jackett.Common/Indexers/notwhatcd.cs b/src/Jackett.Common/Indexers/notwhatcd.cs index d6a4d212b..9f881b22f 100644 --- a/src/Jackett.Common/Indexers/notwhatcd.cs +++ b/src/Jackett.Common/Indexers/notwhatcd.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers.Abstract; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; @@ -33,4 +33,4 @@ namespace Jackett.Common.Indexers AddCategoryMapping(7, TorznabCatType.Books, "Comics"); } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Indexers/pornolab.cs b/src/Jackett.Common/Indexers/pornolab.cs index bc8d061f7..3894aa38f 100644 --- a/src/Jackett.Common/Indexers/pornolab.cs +++ b/src/Jackett.Common/Indexers/pornolab.cs @@ -333,8 +333,8 @@ namespace Jackett.Common.Indexers { logger.Debug(string.Format("{0}: Download selector {1} matched:{2}", ID, downloadSelector, DlUri.OuterHtml)); var href = DlUri.GetAttribute("href"); - downloadlink = new Uri(SiteLink + "forum/" +href); - + downloadlink = new Uri(SiteLink + "forum/" + href); + } else { diff --git a/src/Jackett.Common/Indexers/rutracker.cs b/src/Jackett.Common/Indexers/rutracker.cs index 9bf6a0f91..e4ed9174f 100644 --- a/src/Jackett.Common/Indexers/rutracker.cs +++ b/src/Jackett.Common/Indexers/rutracker.cs @@ -1594,9 +1594,9 @@ namespace Jackett.Common.Indexers } else if (configData.StripRussianLetters.Value) { - if (release.Category.Contains(TorznabCatType.Movies.ID) || - release.Category.Contains(TorznabCatType.MoviesHD.ID) || - release.Category.Contains(TorznabCatType.Movies3D.ID) || + if (release.Category.Contains(TorznabCatType.Movies.ID) || + release.Category.Contains(TorznabCatType.MoviesHD.ID) || + release.Category.Contains(TorznabCatType.Movies3D.ID) || release.Category.Contains(TorznabCatType.MoviesForeign.ID)) { // remove director's name from title @@ -1605,7 +1605,7 @@ namespace Jackett.Common.Indexers // this part should be removed: (Мартин Скорсезе / Martin Scorsese) var director = new Regex(@"(\([А-Яа-яЁё\W]+)\s/\s(.+?)\)"); release.Title = director.Replace(release.Title, ""); - + // Bluray quality fix: radarr parse Blu-ray Disc as Bluray-1080p but should be BR-DISK release.Title = Regex.Replace(release.Title, "Blu-ray Disc", "BR-DISK", RegexOptions.IgnoreCase); // language fix: all rutracker releases contains russian track diff --git a/src/Jackett.Common/Indexers/toloka.cs b/src/Jackett.Common/Indexers/toloka.cs index 2f222930c..b4bf1ddd4 100644 --- a/src/Jackett.Common/Indexers/toloka.cs +++ b/src/Jackett.Common/Indexers/toloka.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; @@ -111,11 +111,11 @@ namespace Jackett.Common.Indexers AddCategoryMapping(137, TorznabCatType.MoviesDVD, "|-Мультфільми та мультсеріали в DVD"); AddCategoryMapping(137, TorznabCatType.TV, "|-Мультфільми та мультсеріали в DVD"); AddCategoryMapping(138, TorznabCatType.MoviesDVD, "|-Документальні фільми в DVD"); - + AddCategoryMapping(237, TorznabCatType.Movies, "Відео для мобільних (iOS, Android, Windows Phone)"); - + AddCategoryMapping(33, TorznabCatType.AudioVideo, "Звукові доріжки та субтитри"); - + AddCategoryMapping(8, TorznabCatType.Audio, "Українська музика (lossy)"); AddCategoryMapping(23, TorznabCatType.Audio, "|-Поп, Естрада"); AddCategoryMapping(24, TorznabCatType.Audio, "|-Джаз, Блюз"); @@ -125,7 +125,7 @@ namespace Jackett.Common.Indexers AddCategoryMapping(36, TorznabCatType.Audio, "|-Реп, Хіп-хоп, РнБ"); AddCategoryMapping(38, TorznabCatType.Audio, "|-Електронна музика"); AddCategoryMapping(56, TorznabCatType.Audio, "|-Невидане"); - + AddCategoryMapping(98, TorznabCatType.AudioLossless, "Українська музика (lossless)"); AddCategoryMapping(100, TorznabCatType.AudioLossless, "|-Поп, Естрада"); AddCategoryMapping(101, TorznabCatType.AudioLossless, "|-Джаз, Блюз"); @@ -134,7 +134,7 @@ namespace Jackett.Common.Indexers AddCategoryMapping(104, TorznabCatType.AudioLossless, "|-Рок, Метал, Альтернатива, Панк, СКА"); AddCategoryMapping(105, TorznabCatType.AudioLossless, "|-Реп, Хіп-хоп, РнБ"); AddCategoryMapping(106, TorznabCatType.AudioLossless, "|-Електронна музика"); - + AddCategoryMapping(11, TorznabCatType.Books, "Друкована література"); AddCategoryMapping(134, TorznabCatType.Books, "|-Українська художня література (до 1991 р.)"); AddCategoryMapping(177, TorznabCatType.Books, "|-Українська художня література (після 1991 р.)"); @@ -145,13 +145,13 @@ namespace Jackett.Common.Indexers AddCategoryMapping(181, TorznabCatType.BooksMagazines, "|-Періодика"); AddCategoryMapping(182, TorznabCatType.Books, "|-Батькам та малятам"); AddCategoryMapping(184, TorznabCatType.BooksComics, "|-Графіка (комікси, манґа, BD та інше)"); - + AddCategoryMapping(185, TorznabCatType.AudioAudiobook, "Аудіокниги українською"); AddCategoryMapping(135, TorznabCatType.AudioAudiobook, "|-Українська художня література"); AddCategoryMapping(186, TorznabCatType.AudioAudiobook, "|-Зарубіжна художня література"); AddCategoryMapping(187, TorznabCatType.AudioAudiobook, "|-Історія, біографістика, спогади"); AddCategoryMapping(189, TorznabCatType.AudioAudiobook, "|-Сирий матеріал"); - + AddCategoryMapping(9, TorznabCatType.PC, "Windows"); AddCategoryMapping(25, TorznabCatType.PC, "|-Windows"); AddCategoryMapping(199, TorznabCatType.PC, "|-Офіс"); @@ -165,7 +165,7 @@ namespace Jackett.Common.Indexers AddCategoryMapping(211, TorznabCatType.PCPhoneAndroid, "|-Android"); AddCategoryMapping(122, TorznabCatType.PCPhoneIOS, "|-iOS"); AddCategoryMapping(40, TorznabCatType.PCPhoneOther, "|-Інші мобільні платформи"); - + // AddCategoryMapping(241, TorznabCatType.Other, "Інше"); // AddCategoryMapping(203, TorznabCatType.Other, "|-Інфодиски, електронні підручники, відеоуроки"); // AddCategoryMapping(12, TorznabCatType.Other, "|-Шпалери, фотографії та зображення"); @@ -258,7 +258,7 @@ namespace Jackett.Common.Indexers var qDownloadLink = Row.QuerySelector("td:nth-child(6) > a"); if (qDownloadLink == null) // Expects moderation continue; - + var qDetailsLink = Row.QuerySelector("td:nth-child(3) > a"); var qSize = Row.QuerySelector("td:nth-child(7)"); diff --git a/src/Jackett.Common/Indexers/yts.cs b/src/Jackett.Common/Indexers/yts.cs index 985b18b30..dd9e5ccb6 100644 --- a/src/Jackett.Common/Indexers/yts.cs +++ b/src/Jackett.Common/Indexers/yts.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -138,7 +138,7 @@ namespace Jackett.Common.Indexers var type = torrent_info.Value("type"); switch (type) { - case "web": + case "web": type = " WEBRip"; break; default: @@ -169,7 +169,7 @@ namespace Jackett.Common.Indexers var dateStr = torrent_info.Value("date_uploaded"); var dateTime = DateTime.ParseExact(dateStr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); release.PublishDate = DateTime.SpecifyKind(dateTime, DateTimeKind.Utc).ToLocalTime(); - release.Link = new Uri(torrent_info.Value("url")); + release.Link = new Uri(torrent_info.Value("url")); release.Seeders = torrent_info.Value("seeds"); release.Peers = torrent_info.Value("peers") + release.Seeders; release.Size = torrent_info.Value("size_bytes"); diff --git a/src/Jackett.Common/JackettProtectedAttribute.cs b/src/Jackett.Common/JackettProtectedAttribute.cs index 98260cf1f..ff561139e 100644 --- a/src/Jackett.Common/JackettProtectedAttribute.cs +++ b/src/Jackett.Common/JackettProtectedAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Jackett.Common { diff --git a/src/Jackett.Common/Models/CachedLog.cs b/src/Jackett.Common/Models/CachedLog.cs index 741ff3c40..5210e85a4 100644 --- a/src/Jackett.Common/Models/CachedLog.cs +++ b/src/Jackett.Common/Models/CachedLog.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Jackett.Common.Models { diff --git a/src/Jackett.Common/Models/CachedQueryResult.cs b/src/Jackett.Common/Models/CachedQueryResult.cs index ab6695afe..f559c0225 100644 --- a/src/Jackett.Common/Models/CachedQueryResult.cs +++ b/src/Jackett.Common/Models/CachedQueryResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Jackett.Common.Models @@ -9,7 +9,8 @@ namespace Jackett.Common.Models private DateTime created; private string query; - public CachedQueryResult(string query, List results){ + public CachedQueryResult(string query, List results) + { this.results = results; created = DateTime.Now; this.query = query; diff --git a/src/Jackett.Common/Models/CachedResult.cs b/src/Jackett.Common/Models/CachedResult.cs index d419b5bd4..e105b4a35 100644 --- a/src/Jackett.Common/Models/CachedResult.cs +++ b/src/Jackett.Common/Models/CachedResult.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Jackett.Common.Models { diff --git a/src/Jackett.Common/Models/CategoryMapping.cs b/src/Jackett.Common/Models/CategoryMapping.cs index 2b3a7011e..5b48d0d10 100644 --- a/src/Jackett.Common/Models/CategoryMapping.cs +++ b/src/Jackett.Common/Models/CategoryMapping.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models +namespace Jackett.Common.Models { class CategoryMapping { diff --git a/src/Jackett.Common/Models/ChannelInfo.cs b/src/Jackett.Common/Models/ChannelInfo.cs index 3375b4286..2be5f2de9 100644 --- a/src/Jackett.Common/Models/ChannelInfo.cs +++ b/src/Jackett.Common/Models/ChannelInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Jackett.Common.Models { diff --git a/src/Jackett.Common/Models/Config/ConsoleOptions.cs b/src/Jackett.Common/Models/Config/ConsoleOptions.cs index 017316842..0332ef84f 100644 --- a/src/Jackett.Common/Models/Config/ConsoleOptions.cs +++ b/src/Jackett.Common/Models/Config/ConsoleOptions.cs @@ -1,4 +1,4 @@ -using CommandLine; +using CommandLine; using System; namespace Jackett.Common.Models.Config @@ -99,4 +99,4 @@ namespace Jackett.Common.Models.Config return runtimeSettings; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/Config/ProxyType.cs b/src/Jackett.Common/Models/Config/ProxyType.cs index 226d1e703..73aec3d7c 100644 --- a/src/Jackett.Common/Models/Config/ProxyType.cs +++ b/src/Jackett.Common/Models/Config/ProxyType.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.Config +namespace Jackett.Common.Models.Config { public enum ProxyType { diff --git a/src/Jackett.Common/Models/Config/RuntimeSettings.cs b/src/Jackett.Common/Models/Config/RuntimeSettings.cs index 5d1fc2180..f662a5134 100644 --- a/src/Jackett.Common/Models/Config/RuntimeSettings.cs +++ b/src/Jackett.Common/Models/Config/RuntimeSettings.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; namespace Jackett.Common.Models.Config @@ -31,7 +31,7 @@ namespace Jackett.Common.Models.Config public string DataFolder { get - { + { if (!string.IsNullOrWhiteSpace(this.CustomDataFolder)) { return this.CustomDataFolder; diff --git a/src/Jackett.Common/Models/Config/ServerConfig.cs b/src/Jackett.Common/Models/Config/ServerConfig.cs index 6912d8d32..8e0c022ac 100644 --- a/src/Jackett.Common/Models/Config/ServerConfig.cs +++ b/src/Jackett.Common/Models/Config/ServerConfig.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Newtonsoft.Json; diff --git a/src/Jackett.Common/Models/DTO/ApiSearch.cs b/src/Jackett.Common/Models/DTO/ApiSearch.cs index ae5c65eb8..9dfa2c5b4 100644 --- a/src/Jackett.Common/Models/DTO/ApiSearch.cs +++ b/src/Jackett.Common/Models/DTO/ApiSearch.cs @@ -1,4 +1,4 @@ -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using Jackett.Common.Utils; namespace Jackett.Common.Models.DTO diff --git a/src/Jackett.Common/Models/DTO/Config.cs b/src/Jackett.Common/Models/DTO/Config.cs index 0dc85d157..13511dee5 100644 --- a/src/Jackett.Common/Models/DTO/Config.cs +++ b/src/Jackett.Common/Models/DTO/Config.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.DTO +namespace Jackett.Common.Models.DTO { public class ConfigItem { diff --git a/src/Jackett.Common/Models/DTO/Indexer.cs b/src/Jackett.Common/Models/DTO/Indexer.cs index 47c075af3..467b10f44 100644 --- a/src/Jackett.Common/Models/DTO/Indexer.cs +++ b/src/Jackett.Common/Models/DTO/Indexer.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using Jackett.Common.Indexers; @@ -60,10 +60,10 @@ namespace Jackett.Common.Models.DTO .Select(g => g.First()) .OrderBy(c => c.ID < 100000 ? "z" + c.ID.ToString() : c.Name) .Select(c => new Capability - { - ID = c.ID.ToString(), - Name = c.Name - }); + { + ID = c.ID.ToString(), + Name = c.Name + }); } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/DTO/ManualSearchResult.cs b/src/Jackett.Common/Models/DTO/ManualSearchResult.cs index 8e0598c2d..a4bed6a1b 100644 --- a/src/Jackett.Common/Models/DTO/ManualSearchResult.cs +++ b/src/Jackett.Common/Models/DTO/ManualSearchResult.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; namespace Jackett.Common.Models.DTO diff --git a/src/Jackett.Common/Models/DTO/ServerConfig.cs b/src/Jackett.Common/Models/DTO/ServerConfig.cs index 4e0c60469..d08030160 100644 --- a/src/Jackett.Common/Models/DTO/ServerConfig.cs +++ b/src/Jackett.Common/Models/DTO/ServerConfig.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; using Jackett.Common.Models.Config; diff --git a/src/Jackett.Common/Models/DTO/TorrentPotatoRequest.cs b/src/Jackett.Common/Models/DTO/TorrentPotatoRequest.cs index 713ba487c..8bd9718c7 100644 --- a/src/Jackett.Common/Models/DTO/TorrentPotatoRequest.cs +++ b/src/Jackett.Common/Models/DTO/TorrentPotatoRequest.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.DTO +namespace Jackett.Common.Models.DTO { public class TorrentPotatoRequest { diff --git a/src/Jackett.Common/Models/DTO/TorrentPotatoResponse.cs b/src/Jackett.Common/Models/DTO/TorrentPotatoResponse.cs index 32f7123c0..4ef56b98a 100644 --- a/src/Jackett.Common/Models/DTO/TorrentPotatoResponse.cs +++ b/src/Jackett.Common/Models/DTO/TorrentPotatoResponse.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace Jackett.Common.Models.DTO diff --git a/src/Jackett.Common/Models/DTO/TorrentPotatoResponseItem.cs b/src/Jackett.Common/Models/DTO/TorrentPotatoResponseItem.cs index 3bef64cf9..8aef1e2ac 100644 --- a/src/Jackett.Common/Models/DTO/TorrentPotatoResponseItem.cs +++ b/src/Jackett.Common/Models/DTO/TorrentPotatoResponseItem.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.DTO +namespace Jackett.Common.Models.DTO { public class TorrentPotatoResponseItem { diff --git a/src/Jackett.Common/Models/DTO/TorznabRequest.cs b/src/Jackett.Common/Models/DTO/TorznabRequest.cs index 0820cd858..3843cad93 100644 --- a/src/Jackett.Common/Models/DTO/TorznabRequest.cs +++ b/src/Jackett.Common/Models/DTO/TorznabRequest.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Jackett.Common.Utils; namespace Jackett.Common.Models.DTO diff --git a/src/Jackett.Common/Models/GitHub/Asset.cs b/src/Jackett.Common/Models/GitHub/Asset.cs index 13bd5cf22..4473f5046 100644 --- a/src/Jackett.Common/Models/GitHub/Asset.cs +++ b/src/Jackett.Common/Models/GitHub/Asset.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.GitHub +namespace Jackett.Common.Models.GitHub { public class Asset { diff --git a/src/Jackett.Common/Models/GitHub/Release.cs b/src/Jackett.Common/Models/GitHub/Release.cs index 94850f1be..a20150ecc 100644 --- a/src/Jackett.Common/Models/GitHub/Release.cs +++ b/src/Jackett.Common/Models/GitHub/Release.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Jackett.Common.Models.GitHub diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs index 2eb741bf0..6de938b3d 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataAbnormal : ConfigurationData { @@ -35,7 +35,7 @@ CredentialsWarning = new DisplayItem("Credentials Configuration (Private Tracker),

  • Username is your account name on this tracker.
  • Password is your password associated to your account name.
") { Name = "Credentials" }; Username = new StringItem { Name = "Username", Value = "" }; Password = new StringItem { Name = "Password", Value = "" }; - PagesWarning = new DisplayItem("Preferences Configuration (Tweak your search settings),

  • Replace MULTI, replace multi keyword in the resultset (leave empty to deactivate)
  • Max Pages to Process let you specify how many page (max) Jackett can process when doing a search. Setting a value higher than 4 is dangerous for you account ! (Result of too many requests to tracker...that will be suspect).
") { Name = "Preferences" }; + PagesWarning = new DisplayItem("Preferences Configuration (Tweak your search settings),

  • Replace MULTI, replace multi keyword in the resultset (leave empty to deactivate)
  • Max Pages to Process let you specify how many page (max) Jackett can process when doing a search. Setting a value higher than 4 is dangerous for you account ! (Result of too many requests to tracker...that will be suspect).
") { Name = "Preferences" }; Pages = new StringItem { Name = "Max Pages to Process (Required)", Value = "4" }; ReplaceMulti = new StringItem() { Name = "Replace MULTI", Value = "MULTI.FRENCH" }; SecurityWarning = new DisplayItem("Security Configuration (Read this area carefully !),

  • Latency Simulation will simulate human browsing with Jacket by pausing Jacket for an random time between each request, to fake a real content browsing.
  • Browser Simulation will simulate a real human browser by injecting additionals headers when doing requests to tracker.
") { Name = "Security" }; @@ -54,6 +54,6 @@ DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false }; HardDriveCache = new BoolItem { Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false }; HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" }; - } + } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAniDub.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAniDub.cs index df999ae08..36ccd3139 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAniDub.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAniDub.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { internal class ConfigurationDataAniDub : ConfigurationDataBasicLogin { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeBytes.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeBytes.cs index 29b434e37..b7750928a 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeBytes.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAnimeBytes.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataAnimeBytes : ConfigurationDataUserPasskey { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataEliteTracker.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataEliteTracker.cs index 38463becc..6406c1b16 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataEliteTracker.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataEliteTracker.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataEliteTracker : ConfigurationDataBasicLogin { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataFileList.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataFileList.cs index 32b4a35b8..fc149fdef 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataFileList.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataFileList.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataFileList : ConfigurationDataBasicLogin { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs index 71a69df3e..81a6d4a79 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataMyAnonamouse : ConfigurationData diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs index b18345ed4..02b1018a2 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Jackett.Common.Models.IndexerConfig.Bespoke @@ -58,4 +58,4 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke return char.ToUpper(s[0]) + s.Substring(1); } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs index 9051508ea..7989aee5a 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataNorbits.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { internal class ConfigurationDataNorbits : ConfigurationData { @@ -49,4 +49,4 @@ HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" }; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs index b9fae1da7..81ea35b1c 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataRutracker : ConfigurationDataCaptchaLogin { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs index 65d4d7cb3..ca303061e 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { public class ConfigurationDataSceneTime : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs index e0f1fbeb5..d9c222f76 100755 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataTVstore.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Jackett.Common.Models.IndexerConfig.Bespoke @@ -43,4 +43,4 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke return char.ToUpper(s[0]) + s.Substring(1); } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataToloka.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataToloka.cs index d2c1f99e4..d9de625c4 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataToloka.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataToloka.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataToloka : ConfigurationDataBasicLogin { diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataXthor.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataXthor.cs index 7d937ecb6..d5b614b27 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataXthor.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataXthor.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig.Bespoke +namespace Jackett.Common.Models.IndexerConfig.Bespoke { class ConfigurationDataXthor : ConfigurationData { @@ -30,4 +30,4 @@ HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" }; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationData.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationData.cs index f90319164..8d6628eab 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationData.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationData.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Jackett.Common.Services.Interfaces; @@ -37,7 +37,7 @@ namespace Jackett.Common.Models.IndexerConfig LoadValuesFromJson(json, ps); } - public void LoadValuesFromJson(JToken json, IProtectionService ps= null) + public void LoadValuesFromJson(JToken json, IProtectionService ps = null) { if (json == null) return; @@ -184,7 +184,7 @@ namespace Jackett.Common.Models.IndexerConfig { return dynamics[ID]; } - catch(KeyNotFoundException) + catch (KeyNotFoundException) { return null; } diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPIKey.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPIKey.cs index fc2107193..840d0e3c0 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPIKey.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPIKey.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataAPIKey : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs index 7d4292f51..257386561 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs @@ -27,4 +27,4 @@ namespace Jackett.Common.Models.IndexerConfig FilterString = new StringItem { Name = "Filters (optional)" }; } } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLogin.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLogin.cs index 0ba168710..41d44c2f4 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLogin.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLogin.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataBasicLogin : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithEmail.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithEmail.cs index 885144cfe..10de1bac4 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithEmail.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithEmail.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataBasicLoginWithEmail : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs index 53d77d7dd..fb72da57f 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataBasicLoginWithFilter : ConfigurationData { @@ -7,7 +7,7 @@ public HiddenItem LastLoggedInCheck { get; private set; } public DisplayItem FilterExample { get; private set; } public StringItem FilterString { get; private set; } - + public ConfigurationDataBasicLoginWithFilter(string FilterInstructions) { Username = new StringItem { Name = "Username" }; diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilterAndPasskey.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilterAndPasskey.cs index bca6bee76..813c27276 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilterAndPasskey.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilterAndPasskey.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataBasicLoginWithFilterAndPasskey : ConfigurationData { @@ -22,4 +22,4 @@ } -} \ No newline at end of file +} diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSS.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSS.cs index b116b5a21..681998dc0 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSS.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSS.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataBasicLoginWithRSS : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSSAndDisplay.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSSAndDisplay.cs index 5c7def71b..5f35120ae 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSSAndDisplay.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataBasicLoginWithRSSAndDisplay.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataBasicLoginWithRSSAndDisplay : ConfigurationData { @@ -12,7 +12,7 @@ Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; RSSKey = new HiddenItem { Name = "RSSKey" }; - DisplayText = new DisplayItem(""){ Name = "" }; + DisplayText = new DisplayItem("") { Name = "" }; } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCaptchaLogin.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCaptchaLogin.cs index 572aacfd1..e07ecf009 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCaptchaLogin.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCaptchaLogin.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { class ConfigurationDataCaptchaLogin : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCookie.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCookie.cs index ca8f51f3e..6fa4e5579 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCookie.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataCookie.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataCookie : ConfigurationData diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginLink.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginLink.cs index 990a5effa..c5c959422 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginLink.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginLink.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataLoginLink : ConfigurationData { @@ -10,7 +10,7 @@ { LoginLink = new StringItem { Name = "Login Link" }; RSSKey = new HiddenItem { Name = "RSSKey" }; - DisplayText = new DisplayItem(""){ Name = "" }; + DisplayText = new DisplayItem("") { Name = "" }; } } } diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginTokin.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginTokin.cs index 9d0e7a876..8d487b108 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginTokin.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataLoginTokin.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using Jackett.Common.Utils; diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs index fb5a1fe82..46b5907f1 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { class ConfigurationDataPinNumber : ConfigurationDataBasicLogin { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataRecaptchaLogin.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataRecaptchaLogin.cs index 81bce1e3d..0a0560b41 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataRecaptchaLogin.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataRecaptchaLogin.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models.IndexerConfig +namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataRecaptchaLogin : ConfigurationData { diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataUrl.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataUrl.cs index a43947198..4541fb4c9 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataUrl.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataUrl.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Jackett.Common.Models.IndexerConfig { diff --git a/src/Jackett.Common/Models/IndexerConfig/ISerializableConfig.cs b/src/Jackett.Common/Models/IndexerConfig/ISerializableConfig.cs index bf9787248..09d114004 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ISerializableConfig.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ISerializableConfig.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Linq; namespace Jackett.Common.Models.IndexerConfig { diff --git a/src/Jackett.Common/Models/IndexerConfigurationStatus.cs b/src/Jackett.Common/Models/IndexerConfigurationStatus.cs index ef62da451..8b6cc207f 100644 --- a/src/Jackett.Common/Models/IndexerConfigurationStatus.cs +++ b/src/Jackett.Common/Models/IndexerConfigurationStatus.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Models +namespace Jackett.Common.Models { public enum IndexerConfigurationStatus { diff --git a/src/Jackett.Common/Models/IndexerDefinition.cs b/src/Jackett.Common/Models/IndexerDefinition.cs index a22bafff8..cfe86b834 100644 --- a/src/Jackett.Common/Models/IndexerDefinition.cs +++ b/src/Jackett.Common/Models/IndexerDefinition.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Jackett.Common.Models diff --git a/src/Jackett.Common/Models/ReleaseInfo.cs b/src/Jackett.Common/Models/ReleaseInfo.cs index 0ac46aedf..213f56e9a 100644 --- a/src/Jackett.Common/Models/ReleaseInfo.cs +++ b/src/Jackett.Common/Models/ReleaseInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Jackett.Common.Indexers; diff --git a/src/Jackett.Common/Models/ResultPage.cs b/src/Jackett.Common/Models/ResultPage.cs index c0671ae1a..398d7ae11 100644 --- a/src/Jackett.Common/Models/ResultPage.cs +++ b/src/Jackett.Common/Models/ResultPage.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/Jackett.Common/Models/TorznabCapabilities.cs b/src/Jackett.Common/Models/TorznabCapabilities.cs index e1610a8b6..97c204b68 100644 --- a/src/Jackett.Common/Models/TorznabCapabilities.cs +++ b/src/Jackett.Common/Models/TorznabCapabilities.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; diff --git a/src/Jackett.Common/Models/TorznabCatType.cs b/src/Jackett.Common/Models/TorznabCatType.cs index 1131359f6..7e04f26c7 100644 --- a/src/Jackett.Common/Models/TorznabCatType.cs +++ b/src/Jackett.Common/Models/TorznabCatType.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace Jackett.Common.Models diff --git a/src/Jackett.Common/Models/TorznabCategory.cs b/src/Jackett.Common/Models/TorznabCategory.cs index 905737834..6b6cf6d01 100644 --- a/src/Jackett.Common/Models/TorznabCategory.cs +++ b/src/Jackett.Common/Models/TorznabCategory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Newtonsoft.Json.Linq; diff --git a/src/Jackett.Common/Models/TorznabQuery.cs b/src/Jackett.Common/Models/TorznabQuery.cs index efbc487ee..bea9fad4b 100644 --- a/src/Jackett.Common/Models/TorznabQuery.cs +++ b/src/Jackett.Common/Models/TorznabQuery.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/Jackett.Common/Models/TrackerCache.cs b/src/Jackett.Common/Models/TrackerCache.cs index f8311fc2c..1b53e59c0 100644 --- a/src/Jackett.Common/Models/TrackerCache.cs +++ b/src/Jackett.Common/Models/TrackerCache.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Jackett.Common.Models { diff --git a/src/Jackett.Common/Models/TrackerCacheResult.cs b/src/Jackett.Common/Models/TrackerCacheResult.cs index f44561886..30630251f 100644 --- a/src/Jackett.Common/Models/TrackerCacheResult.cs +++ b/src/Jackett.Common/Models/TrackerCacheResult.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Jackett.Common.Models { diff --git a/src/Jackett.Common/Plumbing/JackettModule.cs b/src/Jackett.Common/Plumbing/JackettModule.cs index 7869e4831..773b10b8b 100644 --- a/src/Jackett.Common/Plumbing/JackettModule.cs +++ b/src/Jackett.Common/Plumbing/JackettModule.cs @@ -1,4 +1,4 @@ -using Autofac; +using Autofac; using System; using System.Reflection; using System.IO; @@ -17,30 +17,30 @@ namespace Jackett.Common.Plumbing { private RuntimeSettings _runtimeSettings; - public JackettModule (RuntimeSettings runtimeSettings) - { + public JackettModule(RuntimeSettings runtimeSettings) + { _runtimeSettings = runtimeSettings; } protected override void Load(ContainerBuilder builder) { // Just register everything! TODO: Something better and more explicit than scanning everything. - builder.RegisterAssemblyTypes(typeof(JackettModule).Assembly) - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .Except() - .AsImplementedInterfaces().SingleInstance(); + builder.RegisterAssemblyTypes(typeof(JackettModule).Assembly) + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .Except() + .AsImplementedInterfaces().SingleInstance(); builder.RegisterInstance(_runtimeSettings); @@ -131,6 +131,6 @@ namespace Jackett.Common.Plumbing return usehttpclient; } - + } } diff --git a/src/Jackett.Common/Services/CacheService.cs b/src/Jackett.Common/Services/CacheService.cs index b1c030b1a..0db8d8099 100644 --- a/src/Jackett.Common/Services/CacheService.cs +++ b/src/Jackett.Common/Services/CacheService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using AutoMapper; @@ -28,7 +28,7 @@ namespace Jackett.Common.Services cache.Add(trackerCache); } - foreach(var release in releases.OrderByDescending(i=>i.PublishDate)) + foreach (var release in releases.OrderByDescending(i => i.PublishDate)) { var existingItem = trackerCache.Results.Where(i => i.Result.Guid == release.Guid).FirstOrDefault(); if (existingItem == null) @@ -42,7 +42,7 @@ namespace Jackett.Common.Services } // Prune cache - foreach(var tracker in cache) + foreach (var tracker in cache) { tracker.Results = tracker.Results.Where(x => x.Created > DateTime.Now.Subtract(AGE_LIMIT)).OrderByDescending(i => i.Created).Take(MAX_RESULTS_PER_TRACKER).ToList(); } @@ -65,7 +65,8 @@ namespace Jackett.Common.Services } } } - else { + else + { newItemCount++; } @@ -79,9 +80,9 @@ namespace Jackett.Common.Services { var results = new List(); - foreach(var tracker in cache) + foreach (var tracker in cache) { - foreach(var release in tracker.Results.OrderByDescending(i => i.Result.PublishDate).Take(300)) + foreach (var release in tracker.Results.OrderByDescending(i => i.Result.PublishDate).Take(300)) { var item = Mapper.Map(release.Result); item.FirstSeen = release.Created; @@ -92,7 +93,7 @@ namespace Jackett.Common.Services } } - return results.Take(3000).OrderByDescending(i=>i.PublishDate).ToList(); + return results.Take(3000).OrderByDescending(i => i.PublishDate).ToList(); } } } diff --git a/src/Jackett.Common/Services/ConfigurationService.cs b/src/Jackett.Common/Services/ConfigurationService.cs index e2558ba74..00bea3263 100644 --- a/src/Jackett.Common/Services/ConfigurationService.cs +++ b/src/Jackett.Common/Services/ConfigurationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Reflection; @@ -175,7 +175,8 @@ namespace Jackett.Common.Services public string GetContentFolder() { // If we are debugging we can use the non copied content. - string dir = Path.Combine(ApplicationFolder(), "Content"); ; + string dir = Path.Combine(ApplicationFolder(), "Content"); + ; #if DEBUG // When we are running in debug use the source files @@ -204,7 +205,8 @@ namespace Jackett.Common.Services } // If we are debugging we can use the non copied definitions. - string dir = Path.Combine(ApplicationFolder(), "Definitions"); ; + string dir = Path.Combine(ApplicationFolder(), "Definitions"); + ; #if DEBUG // When we are running in debug use the source files @@ -266,7 +268,8 @@ namespace Jackett.Common.Services // Check for legacy settings - var path = Path.Combine(GetAppDataFolder(), "config.json"); ; + var path = Path.Combine(GetAppDataFolder(), "config.json"); + ; var jsonReply = new JObject(); if (File.Exists(path)) { diff --git a/src/Jackett.Common/Services/ImdbResolver.cs b/src/Jackett.Common/Services/ImdbResolver.cs index 746daa699..a81458347 100644 --- a/src/Jackett.Common/Services/ImdbResolver.cs +++ b/src/Jackett.Common/Services/ImdbResolver.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Threading.Tasks; using Jackett.Common.Services.Interfaces; diff --git a/src/Jackett.Common/Services/IndexerConfigurationService.cs b/src/Jackett.Common/Services/IndexerConfigurationService.cs index 8974067b9..992951b10 100644 --- a/src/Jackett.Common/Services/IndexerConfigurationService.cs +++ b/src/Jackett.Common/Services/IndexerConfigurationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using Jackett.Common.Indexers; using Jackett.Common.Services.Interfaces; diff --git a/src/Jackett.Common/Services/IndexerManagerService.cs b/src/Jackett.Common/Services/IndexerManagerService.cs index 9de91af6a..501d56135 100644 --- a/src/Jackett.Common/Services/IndexerManagerService.cs +++ b/src/Jackett.Common/Services/IndexerManagerService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -106,7 +106,8 @@ namespace Jackett.Common.Services { logger.Info("Loading Cardigann definition " + file.FullName); - try { + try + { string DefinitionString = File.ReadAllText(file.FullName); var definition = deserializer.Deserialize(DefinitionString); return definition; diff --git a/src/Jackett.Common/Services/Interfaces/ICacheService.cs b/src/Jackett.Common/Services/Interfaces/ICacheService.cs index 26f18eb87..5e1048588 100644 --- a/src/Jackett.Common/Services/Interfaces/ICacheService.cs +++ b/src/Jackett.Common/Services/Interfaces/ICacheService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Indexers; using Jackett.Common.Models; diff --git a/src/Jackett.Common/Services/Interfaces/IConfigurationService.cs b/src/Jackett.Common/Services/Interfaces/IConfigurationService.cs index 916d95a88..e3153f555 100644 --- a/src/Jackett.Common/Services/Interfaces/IConfigurationService.cs +++ b/src/Jackett.Common/Services/Interfaces/IConfigurationService.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Models.Config; +using Jackett.Common.Models.Config; using System.Collections.Generic; namespace Jackett.Common.Services.Interfaces diff --git a/src/Jackett.Common/Services/Interfaces/IFilePermissionService.cs b/src/Jackett.Common/Services/Interfaces/IFilePermissionService.cs index df817df1a..56c0409d9 100644 --- a/src/Jackett.Common/Services/Interfaces/IFilePermissionService.cs +++ b/src/Jackett.Common/Services/Interfaces/IFilePermissionService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface IFilePermissionService { diff --git a/src/Jackett.Common/Services/Interfaces/IImdbResolver.cs b/src/Jackett.Common/Services/Interfaces/IImdbResolver.cs index bf7820e3f..aad707779 100644 --- a/src/Jackett.Common/Services/Interfaces/IImdbResolver.cs +++ b/src/Jackett.Common/Services/Interfaces/IImdbResolver.cs @@ -1,4 +1,4 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using Jackett.Common.Utils; namespace Jackett.Common.Services.Interfaces diff --git a/src/Jackett.Common/Services/Interfaces/IIndexerConfigurationService.cs b/src/Jackett.Common/Services/Interfaces/IIndexerConfigurationService.cs index eea2c35b0..030f9e04f 100644 --- a/src/Jackett.Common/Services/Interfaces/IIndexerConfigurationService.cs +++ b/src/Jackett.Common/Services/Interfaces/IIndexerConfigurationService.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Indexers; +using Jackett.Common.Indexers; using Newtonsoft.Json.Linq; namespace Jackett.Common.Services.Interfaces diff --git a/src/Jackett.Common/Services/Interfaces/IIndexerManagerService.cs b/src/Jackett.Common/Services/Interfaces/IIndexerManagerService.cs index cbb73f698..408b47e9a 100644 --- a/src/Jackett.Common/Services/Interfaces/IIndexerManagerService.cs +++ b/src/Jackett.Common/Services/Interfaces/IIndexerManagerService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Jackett.Common.Indexers; diff --git a/src/Jackett.Common/Services/Interfaces/ILogCacheService.cs b/src/Jackett.Common/Services/Interfaces/ILogCacheService.cs index 36487fd11..953a245b9 100644 --- a/src/Jackett.Common/Services/Interfaces/ILogCacheService.cs +++ b/src/Jackett.Common/Services/Interfaces/ILogCacheService.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Jackett.Common.Models; namespace Jackett.Common.Services.Interfaces { public interface ILogCacheService { - // void AddLog(LogEventInfo l); + // void AddLog(LogEventInfo l); List Logs { get; } } } diff --git a/src/Jackett.Common/Services/Interfaces/IProcessService.cs b/src/Jackett.Common/Services/Interfaces/IProcessService.cs index 20fabb4d9..685306d56 100644 --- a/src/Jackett.Common/Services/Interfaces/IProcessService.cs +++ b/src/Jackett.Common/Services/Interfaces/IProcessService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface IProcessService { diff --git a/src/Jackett.Common/Services/Interfaces/IProtectionService.cs b/src/Jackett.Common/Services/Interfaces/IProtectionService.cs index 6d9ddb35d..4ead06284 100644 --- a/src/Jackett.Common/Services/Interfaces/IProtectionService.cs +++ b/src/Jackett.Common/Services/Interfaces/IProtectionService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface IProtectionService { diff --git a/src/Jackett.Common/Services/Interfaces/IRunTimeService.cs b/src/Jackett.Common/Services/Interfaces/IRunTimeService.cs index 74b2c034a..1d9a3e057 100644 --- a/src/Jackett.Common/Services/Interfaces/IRunTimeService.cs +++ b/src/Jackett.Common/Services/Interfaces/IRunTimeService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface IRunTimeService { diff --git a/src/Jackett.Common/Services/Interfaces/ISecuityService.cs b/src/Jackett.Common/Services/Interfaces/ISecuityService.cs index 0e2a04807..7412a1aa3 100644 --- a/src/Jackett.Common/Services/Interfaces/ISecuityService.cs +++ b/src/Jackett.Common/Services/Interfaces/ISecuityService.cs @@ -1,4 +1,4 @@ -using System.Net.Http; +using System.Net.Http; namespace Jackett.Common.Services.Interfaces { diff --git a/src/Jackett.Common/Services/Interfaces/ISerializeService.cs b/src/Jackett.Common/Services/Interfaces/ISerializeService.cs index 52ab94090..fe92bfc96 100644 --- a/src/Jackett.Common/Services/Interfaces/ISerializeService.cs +++ b/src/Jackett.Common/Services/Interfaces/ISerializeService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface ISerializeService { diff --git a/src/Jackett.Common/Services/Interfaces/IServerService.cs b/src/Jackett.Common/Services/Interfaces/IServerService.cs index 660c03083..ec004437a 100644 --- a/src/Jackett.Common/Services/Interfaces/IServerService.cs +++ b/src/Jackett.Common/Services/Interfaces/IServerService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Microsoft.AspNetCore.Http; diff --git a/src/Jackett.Common/Services/Interfaces/IServiceConfigService.cs b/src/Jackett.Common/Services/Interfaces/IServiceConfigService.cs index 4d16cf125..f5d4202c9 100644 --- a/src/Jackett.Common/Services/Interfaces/IServiceConfigService.cs +++ b/src/Jackett.Common/Services/Interfaces/IServiceConfigService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface IServiceConfigService { diff --git a/src/Jackett.Common/Services/Interfaces/ITrayLockService.cs b/src/Jackett.Common/Services/Interfaces/ITrayLockService.cs index bcc55086b..5763bb8a4 100644 --- a/src/Jackett.Common/Services/Interfaces/ITrayLockService.cs +++ b/src/Jackett.Common/Services/Interfaces/ITrayLockService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface ITrayLockService { diff --git a/src/Jackett.Common/Services/Interfaces/IUpdateService.cs b/src/Jackett.Common/Services/Interfaces/IUpdateService.cs index ff1e505b9..11fe9937b 100644 --- a/src/Jackett.Common/Services/Interfaces/IUpdateService.cs +++ b/src/Jackett.Common/Services/Interfaces/IUpdateService.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Services.Interfaces +namespace Jackett.Common.Services.Interfaces { public interface IUpdateService { diff --git a/src/Jackett.Common/Services/LogCacheService.cs b/src/Jackett.Common/Services/LogCacheService.cs index 268739fca..e48d248d0 100644 --- a/src/Jackett.Common/Services/LogCacheService.cs +++ b/src/Jackett.Common/Services/LogCacheService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; @@ -9,7 +9,7 @@ namespace Jackett.Common.Services { [Target("LogService")] - public class LogCacheService: TargetWithLayout, ILogCacheService + public class LogCacheService : TargetWithLayout, ILogCacheService { private static List logs = new List(); @@ -21,7 +21,7 @@ namespace Jackett.Common.Services { Level = l.Level.Name, Message = l.FormattedMessage, - When = l.TimeStamp + When = l.TimeStamp }); logs = logs.Take(200).ToList(); } diff --git a/src/Jackett.Common/Services/ProcessService.cs b/src/Jackett.Common/Services/ProcessService.cs index a8fcec88f..382d90d22 100644 --- a/src/Jackett.Common/Services/ProcessService.cs +++ b/src/Jackett.Common/Services/ProcessService.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Text; using Jackett.Common.Services.Interfaces; using NLog; @@ -57,13 +57,15 @@ namespace Jackett.Common.Services public string StartProcessAndGetOutput(string exe, string args, bool keepnewlines = false, bool asAdmin = false) { var sb = new StringBuilder(); - DataReceivedEventHandler rxData = (a, e) => { + DataReceivedEventHandler rxData = (a, e) => + { if (keepnewlines || !string.IsNullOrWhiteSpace(e.Data)) { sb.AppendLine(e.Data); } }; - DataReceivedEventHandler rxError = (s, e) => { + DataReceivedEventHandler rxError = (s, e) => + { if (keepnewlines || !string.IsNullOrWhiteSpace(e.Data)) { sb.AppendLine(e.Data); diff --git a/src/Jackett.Common/Services/SerializeService.cs b/src/Jackett.Common/Services/SerializeService.cs index 5f6aea7f7..f6b291b47 100644 --- a/src/Jackett.Common/Services/SerializeService.cs +++ b/src/Jackett.Common/Services/SerializeService.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Services.Interfaces; +using Jackett.Common.Services.Interfaces; using Newtonsoft.Json; namespace Jackett.Common.Services @@ -8,7 +8,7 @@ namespace Jackett.Common.Services { public string Serialise(object obj) { - return JsonConvert.SerializeObject(obj,Formatting.Indented); + return JsonConvert.SerializeObject(obj, Formatting.Indented); } public T DeSerialise(string json) diff --git a/src/Jackett.Common/Services/SpinService.cs b/src/Jackett.Common/Services/SpinService.cs index 52bccb02f..b303b6965 100644 --- a/src/Jackett.Common/Services/SpinService.cs +++ b/src/Jackett.Common/Services/SpinService.cs @@ -1,4 +1,4 @@ -using System.Threading; +using System.Threading; using Jackett.Common.Services.Interfaces; namespace Jackett.Common.Services diff --git a/src/Jackett.Common/Services/TrayLockService.cs b/src/Jackett.Common/Services/TrayLockService.cs index 58c46f391..5e10fa3ec 100644 --- a/src/Jackett.Common/Services/TrayLockService.cs +++ b/src/Jackett.Common/Services/TrayLockService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using Jackett.Common.Services.Interfaces; @@ -11,7 +11,7 @@ namespace Jackett.Common.Services private EventWaitHandle GetEventHandle() { - return new EventWaitHandle(false, EventResetMode.ManualReset, EVENT_HANDLE_NAME); + return new EventWaitHandle(false, EventResetMode.ManualReset, EVENT_HANDLE_NAME); } public void WaitForSignal() diff --git a/src/Jackett.Common/Services/UpdateService.cs b/src/Jackett.Common/Services/UpdateService.cs index 63e2bc3bf..601777e6b 100644 --- a/src/Jackett.Common/Services/UpdateService.cs +++ b/src/Jackett.Common/Services/UpdateService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -23,7 +23,7 @@ using NLog; namespace Jackett.Common.Services { - public class UpdateService: IUpdateService + public class UpdateService : IUpdateService { Logger logger; WebClient client; @@ -127,7 +127,7 @@ namespace Jackett.Common.Services EmulateBrowser = false }); - if(response.Status != System.Net.HttpStatusCode.OK) + if (response.Status != System.Net.HttpStatusCode.OK) { logger.Error("Failed to get the release list: " + response.Status); } @@ -193,7 +193,7 @@ namespace Jackett.Common.Services else { return Path.Combine(tempDirectory, "Jackett", "JackettUpdater.exe"); - } + } } private string GetCurrentVersion() @@ -223,11 +223,13 @@ namespace Jackett.Common.Services return; } - try { + try + { DirectoryInfo d = new DirectoryInfo(tempDir); foreach (var dir in d.GetDirectories("JackettUpdate-*")) { - try { + try + { logger.Info("Deleting JackettUpdate temp files from " + dir.FullName); dir.Delete(true); } @@ -344,7 +346,7 @@ namespace Jackett.Common.Services } var exe = Path.GetFileName(ExePath()); - var args = string.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(a => a.Contains(" ") ? "\"" + a + "\"" : a )).Replace("\"", "\\\""); + var args = string.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(a => a.Contains(" ") ? "\"" + a + "\"" : a)).Replace("\"", "\\\""); var startInfo = new ProcessStartInfo(); startInfo.UseShellExecute = false; diff --git a/src/Jackett.Common/Services/WindowsServiceConfigService.cs b/src/Jackett.Common/Services/WindowsServiceConfigService.cs index 0fec4f3dc..89aeca717 100644 --- a/src/Jackett.Common/Services/WindowsServiceConfigService.cs +++ b/src/Jackett.Common/Services/WindowsServiceConfigService.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Services.Interfaces; +using Jackett.Common.Services.Interfaces; using NLog; using System; using System.Diagnostics; diff --git a/src/Jackett.Common/Utils/BrowserUtil.cs b/src/Jackett.Common/Utils/BrowserUtil.cs index 0612eaa47..c7ac964ef 100644 --- a/src/Jackett.Common/Utils/BrowserUtil.cs +++ b/src/Jackett.Common/Utils/BrowserUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text.RegularExpressions; namespace Jackett.Common.Utils @@ -7,7 +7,8 @@ namespace Jackett.Common.Utils { public static string ChromeUserAgent { - get { + get + { // When updating these make sure they are not detected by the incapsula bot detection engine (e.g. kickasstorrent indexer) if (System.Environment.OSVersion.Platform == PlatformID.Unix) { diff --git a/src/Jackett.Common/Utils/BuildDate.cs b/src/Jackett.Common/Utils/BuildDate.cs index 8e96915a0..a7b3d3239 100644 --- a/src/Jackett.Common/Utils/BuildDate.cs +++ b/src/Jackett.Common/Utils/BuildDate.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Reflection; diff --git a/src/Jackett.Common/Utils/Clients/BaseWebResult.cs b/src/Jackett.Common/Utils/Clients/BaseWebResult.cs index a186b186b..992b8391d 100644 --- a/src/Jackett.Common/Utils/Clients/BaseWebResult.cs +++ b/src/Jackett.Common/Utils/Clients/BaseWebResult.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Net; namespace Jackett.Common.Utils.Clients @@ -13,13 +13,13 @@ namespace Jackett.Common.Utils.Clients public bool IsRedirect { - get + get { - return Status == System.Net.HttpStatusCode.Redirect || - Status == System.Net.HttpStatusCode.RedirectKeepVerb || - Status == System.Net.HttpStatusCode.RedirectMethod || - Status == System.Net.HttpStatusCode.Found || - Status == System.Net.HttpStatusCode.MovedPermanently; + return Status == System.Net.HttpStatusCode.Redirect || + Status == System.Net.HttpStatusCode.RedirectKeepVerb || + Status == System.Net.HttpStatusCode.RedirectMethod || + Status == System.Net.HttpStatusCode.Found || + Status == System.Net.HttpStatusCode.MovedPermanently; } } } diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient.cs index fad7d5507..951638763 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClient.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs index dfe2c31d6..90da560eb 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs index ebb0999c9..cc1d5b733 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs b/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs index 93a6e01bb..c7ab25fd3 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Jackett.Common/Utils/Clients/WebByteResult.cs b/src/Jackett.Common/Utils/Clients/WebByteResult.cs index 4f95003fe..102d7f201 100644 --- a/src/Jackett.Common/Utils/Clients/WebByteResult.cs +++ b/src/Jackett.Common/Utils/Clients/WebByteResult.cs @@ -1,4 +1,4 @@ -namespace Jackett.Common.Utils.Clients +namespace Jackett.Common.Utils.Clients { public class WebClientByteResult : BaseWebResult { diff --git a/src/Jackett.Common/Utils/Clients/WebClient.cs b/src/Jackett.Common/Utils/Clients/WebClient.cs index 1e39c30da..d775b213d 100644 --- a/src/Jackett.Common/Utils/Clients/WebClient.cs +++ b/src/Jackett.Common/Utils/Clients/WebClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Net.Http; using System.Net.Http.Headers; diff --git a/src/Jackett.Common/Utils/Clients/WebClientResult.cs b/src/Jackett.Common/Utils/Clients/WebClientResult.cs index fdb25e791..c512aba66 100644 --- a/src/Jackett.Common/Utils/Clients/WebClientResult.cs +++ b/src/Jackett.Common/Utils/Clients/WebClientResult.cs @@ -1,6 +1,6 @@ -namespace Jackett.Common.Utils.Clients +namespace Jackett.Common.Utils.Clients { - public class WebClientStringResult: BaseWebResult + public class WebClientStringResult : BaseWebResult { public string Content { get; set; } } diff --git a/src/Jackett.Common/Utils/Clients/WebRequest.cs b/src/Jackett.Common/Utils/Clients/WebRequest.cs index e50c969a1..69b764376 100644 --- a/src/Jackett.Common/Utils/Clients/WebRequest.cs +++ b/src/Jackett.Common/Utils/Clients/WebRequest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/Jackett.Common/Utils/DataUrl.cs b/src/Jackett.Common/Utils/DataUrl.cs index a20ad8448..f64bbaf4f 100644 --- a/src/Jackett.Common/Utils/DataUrl.cs +++ b/src/Jackett.Common/Utils/DataUrl.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using MimeMapping; diff --git a/src/Jackett.Common/Utils/DateTimeUtil.cs b/src/Jackett.Common/Utils/DateTimeUtil.cs index 826f905bd..293a76f46 100644 --- a/src/Jackett.Common/Utils/DateTimeUtil.cs +++ b/src/Jackett.Common/Utils/DateTimeUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Text.RegularExpressions; @@ -61,7 +61,7 @@ namespace Jackett.Common.Utils timeAgo += TimeSpan.FromMinutes(val); else if (unit.Contains("hour") || unit.Contains("hr") || unit == "h") timeAgo += TimeSpan.FromHours(val); - else if (unit.Contains("day") ||unit == "d") + else if (unit.Contains("day") || unit == "d") timeAgo += TimeSpan.FromDays(val); else if (unit.Contains("week") || unit.Contains("wk") || unit == "w") timeAgo += TimeSpan.FromDays(val * 7); @@ -71,7 +71,7 @@ namespace Jackett.Common.Utils timeAgo += TimeSpan.FromDays(val * 365); else { - throw new Exception("TimeAgo parsing failed, unknown unit: "+unit); + throw new Exception("TimeAgo parsing failed, unknown unit: " + unit); } } @@ -87,7 +87,7 @@ namespace Jackett.Common.Utils if (time.EndsWith("AM")) { time = time.Substring(0, time.Length - 2); - if(time.StartsWith("12")) // 12:15 AM becomes 00:15 + if (time.StartsWith("12")) // 12:15 AM becomes 00:15 time = "00" + time.Substring(2); } else if (time.EndsWith("PM")) @@ -129,11 +129,12 @@ namespace Jackett.Common.Utils public static DateTime FromUnknown(string str, string format = null) { - try { + try + { str = ParseUtil.NormalizeSpace(str); Match match; - if(str.ToLower().Contains("now")) + if (str.ToLower().Contains("now")) { return DateTime.UtcNow; } @@ -188,19 +189,19 @@ namespace Jackett.Common.Utils var dow = DayOfWeek.Monday; var groupMatchLower = match.Groups[1].Value.ToLower(); - if (groupMatchLower.StartsWith("monday")) + if (groupMatchLower.StartsWith("monday")) dow = DayOfWeek.Monday; - else if (groupMatchLower.StartsWith("tuesday")) + else if (groupMatchLower.StartsWith("tuesday")) dow = DayOfWeek.Tuesday; - else if (groupMatchLower.StartsWith("wednesday")) + else if (groupMatchLower.StartsWith("wednesday")) dow = DayOfWeek.Wednesday; - else if (groupMatchLower.StartsWith("thursday")) + else if (groupMatchLower.StartsWith("thursday")) dow = DayOfWeek.Thursday; - else if (groupMatchLower.StartsWith("friday")) + else if (groupMatchLower.StartsWith("friday")) dow = DayOfWeek.Friday; - else if (groupMatchLower.StartsWith("saturday")) + else if (groupMatchLower.StartsWith("saturday")) dow = DayOfWeek.Saturday; - else + else dow = DayOfWeek.Sunday; while (dt.DayOfWeek != dow) @@ -224,7 +225,7 @@ namespace Jackett.Common.Utils if (match.Success) { var date = match.Groups[1].Value; - string newDate = DateTime.Now.Year.ToString()+ "-"+date; + string newDate = DateTime.Now.Year.ToString() + "-" + date; str = str.Replace(date, newDate); } diff --git a/src/Jackett.Common/Utils/DotNetCoreUtil.cs b/src/Jackett.Common/Utils/DotNetCoreUtil.cs index 529528d92..74efe7786 100644 --- a/src/Jackett.Common/Utils/DotNetCoreUtil.cs +++ b/src/Jackett.Common/Utils/DotNetCoreUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.InteropServices; namespace Jackett.Common.Utils diff --git a/src/Jackett.Common/Utils/EnvironmentUtil.cs b/src/Jackett.Common/Utils/EnvironmentUtil.cs index 487a324dd..2da0c85a5 100644 --- a/src/Jackett.Common/Utils/EnvironmentUtil.cs +++ b/src/Jackett.Common/Utils/EnvironmentUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using System.Reflection; @@ -7,7 +7,7 @@ namespace Jackett.Common.Utils { public static class EnvironmentUtil { - + public static string JackettVersion { get diff --git a/src/Jackett.Common/Utils/Extensions.cs b/src/Jackett.Common/Utils/Extensions.cs index 6422bf5b4..367fca378 100644 --- a/src/Jackett.Common/Utils/Extensions.cs +++ b/src/Jackett.Common/Utils/Extensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Jackett.Common/Utils/JsonContent.cs b/src/Jackett.Common/Utils/JsonContent.cs index 3e2bb9f54..2039aaeb2 100644 --- a/src/Jackett.Common/Utils/JsonContent.cs +++ b/src/Jackett.Common/Utils/JsonContent.cs @@ -1,4 +1,4 @@ -using System.Net.Http; +using System.Net.Http; using System.Text; using Newtonsoft.Json; diff --git a/src/Jackett.Common/Utils/JsonUtil.cs b/src/Jackett.Common/Utils/JsonUtil.cs index 144f6891b..bf5ee7abf 100644 --- a/src/Jackett.Common/Utils/JsonUtil.cs +++ b/src/Jackett.Common/Utils/JsonUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using Newtonsoft.Json; diff --git a/src/Jackett.Common/Utils/LoggingSetup.cs b/src/Jackett.Common/Utils/LoggingSetup.cs index 54a637dcb..0505fb152 100644 --- a/src/Jackett.Common/Utils/LoggingSetup.cs +++ b/src/Jackett.Common/Utils/LoggingSetup.cs @@ -1,4 +1,4 @@ -using Jackett.Common.Models.Config; +using Jackett.Common.Models.Config; using Jackett.Common.Services; using NLog; using NLog.Config; diff --git a/src/Jackett.Common/Utils/ParseUtil.cs b/src/Jackett.Common/Utils/ParseUtil.cs index 944c975c2..6c251a6ce 100644 --- a/src/Jackett.Common/Utils/ParseUtil.cs +++ b/src/Jackett.Common/Utils/ParseUtil.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using System.Linq; using System.Text.RegularExpressions; using Microsoft.AspNetCore.WebUtilities; @@ -20,7 +20,8 @@ namespace Jackett.Common.Utils public static string NormalizeMultiSpaces(string s) { - return new Regex(@"\s+").Replace(NormalizeSpace(s), " "); ; + return new Regex(@"\s+").Replace(NormalizeSpace(s), " "); + ; } public static string NormalizeNumber(string s) @@ -114,7 +115,7 @@ namespace Jackett.Common.Utils var imdbid = GetImdbID(imdbstr); if (imdbid == null) return null; - + return "tt" + ((int)imdbid).ToString("D7"); } } diff --git a/src/Jackett.Common/Utils/ServerUtil.cs b/src/Jackett.Common/Utils/ServerUtil.cs index dbc332121..24c132f08 100644 --- a/src/Jackett.Common/Utils/ServerUtil.cs +++ b/src/Jackett.Common/Utils/ServerUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Security.Principal; using Jackett.Common.Utils.Clients; diff --git a/src/Jackett.Common/Utils/StringCipher.cs b/src/Jackett.Common/Utils/StringCipher.cs index f206968de..b936626b3 100644 --- a/src/Jackett.Common/Utils/StringCipher.cs +++ b/src/Jackett.Common/Utils/StringCipher.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using System.Security.Cryptography; diff --git a/src/Jackett.Common/Utils/StringUtil.cs b/src/Jackett.Common/Utils/StringUtil.cs index c19d58671..5c5df9df1 100644 --- a/src/Jackett.Common/Utils/StringUtil.cs +++ b/src/Jackett.Common/Utils/StringUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; @@ -131,9 +131,12 @@ namespace Jackett.Common.Utils var repl = replacement ?? '\0'; if (fancy) { - if (c == '"') repl = '”'; // U+201D right double quotation mark - else if (c == '\'') repl = '’'; // U+2019 right single quotation mark - else if (c == '/') repl = '⁄'; // U+2044 fraction slash + if (c == '"') + repl = '”'; // U+201D right double quotation mark + else if (c == '\'') + repl = '’'; // U+2019 right single quotation mark + else if (c == '/') + repl = '⁄'; // U+2044 fraction slash } if (repl != '\0') sb.Append(repl); diff --git a/src/Jackett.Common/Utils/TorznabCapsUtil.cs b/src/Jackett.Common/Utils/TorznabCapsUtil.cs index 5fa604b5e..0d817a6da 100644 --- a/src/Jackett.Common/Utils/TorznabCapsUtil.cs +++ b/src/Jackett.Common/Utils/TorznabCapsUtil.cs @@ -1,4 +1,4 @@ -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using Jackett.Common.Models; namespace Jackett.Common.Utils diff --git a/src/Jackett.Common/Utils/TvCategoryParser.cs b/src/Jackett.Common/Utils/TvCategoryParser.cs index c7fcb68b8..a39273a63 100644 --- a/src/Jackett.Common/Utils/TvCategoryParser.cs +++ b/src/Jackett.Common/Utils/TvCategoryParser.cs @@ -1,4 +1,4 @@ -//Regex sourced from Sonarr - https://github.com/Sonarr/Sonarr/blob/develop/src/NzbDrone.Core/Parser/QualityParser.cs +//Regex sourced from Sonarr - https://github.com/Sonarr/Sonarr/blob/develop/src/NzbDrone.Core/Parser/QualityParser.cs using System.Text.RegularExpressions; using Jackett.Common.Models; diff --git a/src/Jackett.Common/Utils/Variants.cs b/src/Jackett.Common/Utils/Variants.cs index aa7ad2a58..83c7f1ff2 100644 --- a/src/Jackett.Common/Utils/Variants.cs +++ b/src/Jackett.Common/Utils/Variants.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.InteropServices; namespace Jackett.Common.Utils @@ -70,37 +70,37 @@ namespace Jackett.Common.Utils switch (variant) { case JackettVariant.FullFrameworkWindows: - { - return "Jackett.Binaries.Windows.zip"; - } + { + return "Jackett.Binaries.Windows.zip"; + } case JackettVariant.Mono: - { - return "Jackett.Binaries.Mono.tar.gz"; - } + { + return "Jackett.Binaries.Mono.tar.gz"; + } case JackettVariant.CoreWindows: - { - return "Jackett.Binaries.Windows.zip"; - } + { + return "Jackett.Binaries.Windows.zip"; + } case JackettVariant.CoreMacOs: - { - return "Jackett.Binaries.macOS.tar.gz"; - } + { + return "Jackett.Binaries.macOS.tar.gz"; + } case JackettVariant.CoreLinuxAmdx64: - { - return "Jackett.Binaries.LinuxAMDx64.tar.gz"; - } + { + return "Jackett.Binaries.LinuxAMDx64.tar.gz"; + } case JackettVariant.CoreLinuxArm32: - { - return "Jackett.Binaries.LinuxARM32.tar.gz"; - } + { + return "Jackett.Binaries.LinuxARM32.tar.gz"; + } case JackettVariant.CoreLinuxArm64: - { - return "Jackett.Binaries.LinuxARM64.tar.gz"; - } + { + return "Jackett.Binaries.LinuxARM64.tar.gz"; + } default: - { - return ""; - } + { + return ""; + } } } diff --git a/src/Jackett.IntegrationTests/WebDriverFactory.cs b/src/Jackett.IntegrationTests/WebDriverFactory.cs index 2013da0e1..424d4e9cb 100644 --- a/src/Jackett.IntegrationTests/WebDriverFactory.cs +++ b/src/Jackett.IntegrationTests/WebDriverFactory.cs @@ -11,7 +11,8 @@ namespace Jackett.IntegrationTests // of initializing Selenium, you can keep using that as-is and ignore this sample file; skip ahead to SamplePageTests.cs. public static class WebDriverFactory { - public static IWebDriver CreateFromEnvironmentVariableSettings() { + public static IWebDriver CreateFromEnvironmentVariableSettings() + { // This environment variable gets set by our Azure Pipelines build definition in ./azure-pipelines.yml. // That file uses a matrix strategy to run multiple different build jobs for different combinations of OS/browser. // Each job sets this environment variable accordingly, and we use it to decide which browser the tests will use. diff --git a/src/Jackett.Server/ActionFilters/DownloadActionFilter.cs b/src/Jackett.Server/ActionFilters/DownloadActionFilter.cs index 4734bbf24..933fedd33 100644 --- a/src/Jackett.Server/ActionFilters/DownloadActionFilter.cs +++ b/src/Jackett.Server/ActionFilters/DownloadActionFilter.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.WebUtilities; namespace Jackett.Server.ActionFilters { - public class DownloadActionFilter: ActionFilterAttribute + public class DownloadActionFilter : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { diff --git a/src/Jackett.Server/Controllers/UIController.cs b/src/Jackett.Server/Controllers/UIController.cs index 27d320064..0f296bbc1 100644 --- a/src/Jackett.Server/Controllers/UIController.cs +++ b/src/Jackett.Server/Controllers/UIController.cs @@ -44,7 +44,8 @@ namespace Jackett.Server.Controllers return Redirect("Dashboard"); } - return new PhysicalFileResult(config.GetContentFolder() + "/login.html", "text/html"); ; + return new PhysicalFileResult(config.GetContentFolder() + "/login.html", "text/html"); + ; } [HttpGet] diff --git a/src/Jackett.Server/Middleware/RedirectRules.cs b/src/Jackett.Server/Middleware/RedirectRules.cs index f93a7a050..9cd94d609 100644 --- a/src/Jackett.Server/Middleware/RedirectRules.cs +++ b/src/Jackett.Server/Middleware/RedirectRules.cs @@ -11,7 +11,7 @@ namespace Jackett.Server.Middleware { HttpRequest request = context.HttpContext.Request; - if (request.Path == null || string.IsNullOrWhiteSpace(request.Path.ToString()) || request.Path.ToString() == "/" + if (request.Path == null || string.IsNullOrWhiteSpace(request.Path.ToString()) || request.Path.ToString() == "/" || request.Path.ToString().Equals("/index.html", StringComparison.OrdinalIgnoreCase)) { // 301 is the status code of permanent redirect diff --git a/src/Jackett.Server/Services/ProtectionService.cs b/src/Jackett.Server/Services/ProtectionService.cs index ecd00fbbe..fa4d39bc3 100644 --- a/src/Jackett.Server/Services/ProtectionService.cs +++ b/src/Jackett.Server/Services/ProtectionService.cs @@ -37,7 +37,7 @@ namespace Jackett.Server.Services _protector = provider.CreateProtector(purpose); } - + } public string Protect(string plainText) diff --git a/src/Jackett.Server/Services/ServiceConfigService.cs b/src/Jackett.Server/Services/ServiceConfigService.cs index a0ff5ac4d..75e65369e 100644 --- a/src/Jackett.Server/Services/ServiceConfigService.cs +++ b/src/Jackett.Server/Services/ServiceConfigService.cs @@ -92,7 +92,7 @@ namespace Jackett.Server.Services public void RemoveService() { var service = GetService(NAME); - if(service == null) + if (service == null) { logger.Warn("The service is already uninstalled"); return; diff --git a/src/Jackett.Test/Services/ProtectionServiceTests.cs b/src/Jackett.Test/Services/ProtectionServiceTests.cs index e01e93137..6b75ca799 100644 --- a/src/Jackett.Test/Services/ProtectionServiceTests.cs +++ b/src/Jackett.Test/Services/ProtectionServiceTests.cs @@ -6,7 +6,7 @@ using Jackett.Common.Services.Interfaces; namespace Jackett.Test.Services { [TestFixture] - class ProtectionServiceTests : TestBase + class ProtectionServiceTests : TestBase { [Test] diff --git a/src/Jackett.Test/TestUtil.cs b/src/Jackett.Test/TestUtil.cs index 7098d6576..56a30f840 100644 --- a/src/Jackett.Test/TestUtil.cs +++ b/src/Jackett.Test/TestUtil.cs @@ -19,7 +19,7 @@ namespace Jackett.Test { IDataProtectionProvider dataProtectionProvider = new EphemeralDataProtectionProvider(); - var builder = new ContainerBuilder(); + var builder = new ContainerBuilder(); builder.RegisterModule(new JackettModule(new RuntimeSettings())); builder.RegisterType().As(); builder.RegisterType().As().SingleInstance(); @@ -39,7 +39,7 @@ namespace Jackett.Test public static IContainer Container { - get { return testContainer; } + get { return testContainer; } } public static void RegisterByteCall(WebRequest r, Func f) @@ -57,7 +57,7 @@ namespace Jackett.Test public static string GetResource(string item) { var assembly = Assembly.GetExecutingAssembly(); - var resourceName = "Jackett.Test." + item.Replace('/','.'); + var resourceName = "Jackett.Test." + item.Replace('/', '.'); using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { diff --git a/src/Jackett.Test/TestWebClient.cs b/src/Jackett.Test/TestWebClient.cs index 7d8173d5c..432e5c84d 100644 --- a/src/Jackett.Test/TestWebClient.cs +++ b/src/Jackett.Test/TestWebClient.cs @@ -34,7 +34,7 @@ namespace Jackett.Test override public Task GetBytes(WebRequest request) { - return Task.FromResult< WebClientByteResult>(byteCallbacks.Where(r => r.Key.Equals(request)).First().Value.Invoke(request)); + return Task.FromResult(byteCallbacks.Where(r => r.Key.Equals(request)).First().Value.Invoke(request)); } override public Task GetString(WebRequest request) @@ -44,7 +44,7 @@ namespace Jackett.Test override public void Init() { - + } } } diff --git a/src/Jackett.Test/Util/ParseUtilTests.cs b/src/Jackett.Test/Util/ParseUtilTests.cs index 9f11c6ffd..1310c5e44 100644 --- a/src/Jackett.Test/Util/ParseUtilTests.cs +++ b/src/Jackett.Test/Util/ParseUtilTests.cs @@ -15,13 +15,13 @@ namespace Jackett.Test.Util { get { - var type = typeof(ParseUtilTests); + var type = typeof(ParseUtilTests); using (var resourceStream = type.Assembly.GetManifestResourceStream($"{type.Namespace}.Invalid-RSS.xml")) using (var sr = new StreamReader(resourceStream)) { return sr.ReadToEnd(); } - + } } diff --git a/src/Jackett.Test/WebUtilityHelpersTests.cs b/src/Jackett.Test/WebUtilityHelpersTests.cs index f2b37da44..d967109fd 100644 --- a/src/Jackett.Test/WebUtilityHelpersTests.cs +++ b/src/Jackett.Test/WebUtilityHelpersTests.cs @@ -34,7 +34,7 @@ namespace Jackett.Test }; } - + [TestMethod] public void WebUtilityHelpers_UrlEncode_CorrectlyEncodes() diff --git a/src/Jackett.Updater/Program.cs b/src/Jackett.Updater/Program.cs index 0de8490d8..4ef4f4160 100644 --- a/src/Jackett.Updater/Program.cs +++ b/src/Jackett.Updater/Program.cs @@ -537,7 +537,7 @@ namespace Jackett.Updater } try - { + { if (!Directory.Exists(fileDestinationDirectory)) { logger.Info("Creating directory " + fileDestinationDirectory); @@ -558,8 +558,8 @@ namespace Jackett.Updater private string GetUpdateLocation() { - // Use EscapedCodeBase to avoid Uri reserved characters from causing bugs - // https://stackoverflow.com/questions/896572 + // Use EscapedCodeBase to avoid Uri reserved characters from causing bugs + // https://stackoverflow.com/questions/896572 var location = new Uri(Assembly.GetEntryAssembly().GetName().EscapedCodeBase); // Use LocalPath instead of AbsolutePath to avoid needing to unescape Uri format. return new FileInfo(location.LocalPath).DirectoryName;