From 715274bcc7d489346faafc4cbb89d64a1151bffe Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 2 Oct 2024 09:35:45 +0300 Subject: [PATCH] Improve indexer name for RED --- .../Indexers/FileList/FileListSettings.cs | 14 +++++++------- src/NzbDrone.Core/Indexers/Gazelle/Gazelle.cs | 1 - src/NzbDrone.Core/Indexers/Redacted/Redacted.cs | 2 +- .../Indexers/Redacted/RedactedParser.cs | 3 ++- .../Indexers/Redacted/RedactedSettings.cs | 6 +++++- src/NzbDrone.Core/Localization/Core/en.json | 2 ++ 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/FileList/FileListSettings.cs b/src/NzbDrone.Core/Indexers/FileList/FileListSettings.cs index 09eca5d4f..2f587e6ef 100644 --- a/src/NzbDrone.Core/Indexers/FileList/FileListSettings.cs +++ b/src/NzbDrone.Core/Indexers/FileList/FileListSettings.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Indexers.FileList public class FileListSettings : ITorrentIndexerSettings { - private static readonly FileListSettingsValidator Validator = new FileListSettingsValidator(); + private static readonly FileListSettingsValidator Validator = new (); public FileListSettings() { @@ -33,15 +33,15 @@ namespace NzbDrone.Core.Indexers.FileList }; } - [FieldDefinition(0, Label = "Username", Privacy = PrivacyLevel.UserName)] + [FieldDefinition(0, Label = "IndexerSettingsApiUrl", Advanced = true, HelpTextWarning = "IndexerSettingsApiUrlHelpText")] + public string BaseUrl { get; set; } + + [FieldDefinition(1, Label = "Username", Privacy = PrivacyLevel.UserName)] public string Username { get; set; } - [FieldDefinition(1, Label = "Passkey", Privacy = PrivacyLevel.ApiKey)] + [FieldDefinition(2, Label = "Passkey", Privacy = PrivacyLevel.ApiKey)] public string Passkey { get; set; } - [FieldDefinition(3, Label = "API URL", Advanced = true, HelpText = "Do not change this unless you know what you're doing. Since your API key will be sent to that host.")] - public string BaseUrl { get; set; } - [FieldDefinition(4, Label = "Categories", Type = FieldType.Select, SelectOptions = typeof(FileListCategories), HelpText = "Categories for use in search and feeds")] public IEnumerable Categories { get; set; } @@ -52,7 +52,7 @@ namespace NzbDrone.Core.Indexers.FileList public int MinimumSeeders { get; set; } [FieldDefinition(7)] - public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings(); + public SeedCriteriaSettings SeedCriteria { get; set; } = new (); [FieldDefinition(8, Type = FieldType.Checkbox, Label = "IndexerSettingsRejectBlocklistedTorrentHashes", HelpText = "IndexerSettingsRejectBlocklistedTorrentHashesHelpText", Advanced = true)] public bool RejectBlocklistedTorrentHashesWhileGrabbing { get; set; } diff --git a/src/NzbDrone.Core/Indexers/Gazelle/Gazelle.cs b/src/NzbDrone.Core/Indexers/Gazelle/Gazelle.cs index 3ed452a57..dac760cb7 100644 --- a/src/NzbDrone.Core/Indexers/Gazelle/Gazelle.cs +++ b/src/NzbDrone.Core/Indexers/Gazelle/Gazelle.cs @@ -68,7 +68,6 @@ namespace NzbDrone.Core.Indexers.Gazelle get { yield return GetDefinition("Orpheus Network", GetSettings("https://orpheus.network")); - yield return GetDefinition("Not What CD", GetSettings("https://notwhat.cd")); } } diff --git a/src/NzbDrone.Core/Indexers/Redacted/Redacted.cs b/src/NzbDrone.Core/Indexers/Redacted/Redacted.cs index 997a16923..871e0f8bb 100644 --- a/src/NzbDrone.Core/Indexers/Redacted/Redacted.cs +++ b/src/NzbDrone.Core/Indexers/Redacted/Redacted.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Indexers.Redacted { public class Redacted : HttpIndexerBase { - public override string Name => "Redacted"; + public override string Name => "Redacted.ch"; public override DownloadProtocol Protocol => DownloadProtocol.Torrent; public override bool SupportsRss => true; public override bool SupportsSearch => true; diff --git a/src/NzbDrone.Core/Indexers/Redacted/RedactedParser.cs b/src/NzbDrone.Core/Indexers/Redacted/RedactedParser.cs index c3f09baa3..6cdf8c7a0 100644 --- a/src/NzbDrone.Core/Indexers/Redacted/RedactedParser.cs +++ b/src/NzbDrone.Core/Indexers/Redacted/RedactedParser.cs @@ -55,12 +55,13 @@ namespace NzbDrone.Core.Indexers.Redacted var id = torrent.TorrentId; var title = WebUtility.HtmlDecode(GetTitle(result, torrent)); var infoUrl = GetInfoUrl(result.GroupId, id); + var isFreeLeech = torrent.IsFreeLeech || torrent.IsNeutralLeech || torrent.IsFreeload || torrent.IsPersonalFreeLeech; torrentInfos.Add(new GazelleInfo { Guid = infoUrl, InfoUrl = infoUrl, - DownloadUrl = GetDownloadUrl(id, !torrent.IsFreeLeech && !torrent.IsNeutralLeech && !torrent.IsFreeload && !torrent.IsPersonalFreeLeech), + DownloadUrl = GetDownloadUrl(id, torrent.CanUseToken && !isFreeLeech), Title = title, Artist = WebUtility.HtmlDecode(result.Artist), Album = WebUtility.HtmlDecode(result.GroupName), diff --git a/src/NzbDrone.Core/Indexers/Redacted/RedactedSettings.cs b/src/NzbDrone.Core/Indexers/Redacted/RedactedSettings.cs index ed0001780..6fad07bed 100644 --- a/src/NzbDrone.Core/Indexers/Redacted/RedactedSettings.cs +++ b/src/NzbDrone.Core/Indexers/Redacted/RedactedSettings.cs @@ -20,10 +20,14 @@ namespace NzbDrone.Core.Indexers.Redacted public RedactedSettings() { BaseUrl = "https://redacted.ch"; - Categories = new[] { (int)RedactedCategory.Music }; + Categories = new[] + { + (int)RedactedCategory.Music + }; MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS; } + [FieldDefinition(0, Label = "IndexerSettingsApiUrl", Advanced = true, HelpTextWarning = "IndexerSettingsApiUrlHelpText")] public string BaseUrl { get; set; } [FieldDefinition(1, Label = "ApiKey", HelpText = "Generate this in 'Access Settings' in your Redacted profile", Privacy = PrivacyLevel.ApiKey)] diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 81cdb9c3f..56ce142b4 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -601,6 +601,8 @@ "IndexerSearchCheckNoAvailableIndexersMessage": "All search-capable indexers are temporarily unavailable due to recent indexer errors", "IndexerSearchCheckNoInteractiveMessage": "No indexers available with Interactive Search enabled, {appName} will not provide any interactive search results", "IndexerSettings": "Indexer Settings", + "IndexerSettingsApiUrl": "API URL", + "IndexerSettingsApiUrlHelpText": "Do not change this unless you know what you're doing. Since your API key will be sent to that host.", "IndexerSettingsRejectBlocklistedTorrentHashes": "Reject Blocklisted Torrent Hashes While Grabbing", "IndexerSettingsRejectBlocklistedTorrentHashesHelpText": "If a torrent is blocked by hash it may not properly be rejected during RSS/Search for some indexers, enabling this will allow it to be rejected after the torrent is grabbed, but before it is sent to the client.", "IndexerSettingsSeedRatio": "Seed Ratio",