From bd79d3c828944c4911b6473f4e913cb757d223a9 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Mon, 21 Jun 2021 23:47:31 -0500 Subject: [PATCH] Fixed: Cardigann Indexer Descriptions & Indexer InfoLinks --- .../Indexers/Definitions/Cardigann/Cardigann.cs | 1 + src/Prowlarr.Api.V1/Indexers/IndexerResource.cs | 5 +++++ src/Prowlarr.Api.V1/ProviderResource.cs | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/Cardigann.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/Cardigann.cs index 0faa1ec1c..5f66201d5 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/Cardigann.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/Cardigann.cs @@ -118,6 +118,7 @@ namespace NzbDrone.Core.Indexers.Cardigann Enable = true, Name = definition.Name, Language = definition.Language, + Description = definition.Description, Implementation = GetType().Name, Settings = new CardigannSettings { DefinitionFile = definition.File }, Protocol = DownloadProtocol.Torrent, diff --git a/src/Prowlarr.Api.V1/Indexers/IndexerResource.cs b/src/Prowlarr.Api.V1/Indexers/IndexerResource.cs index c6c7ed9e3..5b93209cb 100644 --- a/src/Prowlarr.Api.V1/Indexers/IndexerResource.cs +++ b/src/Prowlarr.Api.V1/Indexers/IndexerResource.cs @@ -51,6 +51,8 @@ namespace Prowlarr.Api.V1.Indexers var resource = base.ToResource(definition); + var infoLinkName = definition.ImplementationName; + if (definition.Implementation == typeof(Cardigann).Name) { var extraFields = definition.ExtraFields?.Select((x, i) => MapField(x, i)).ToList() ?? new List(); @@ -66,8 +68,11 @@ namespace Prowlarr.Api.V1.Indexers field.Value = setting.Value; } } + + infoLinkName = settings.DefinitionFile; } + resource.InfoLink = string.Format("https://wiki.servarr.com/prowlarr/supported-indexers#{0}", infoLinkName.ToLower().Replace(' ', '-')); resource.AppProfileId = definition.AppProfileId; resource.BaseUrl = definition.BaseUrl; resource.Description = definition.Description; diff --git a/src/Prowlarr.Api.V1/ProviderResource.cs b/src/Prowlarr.Api.V1/ProviderResource.cs index ea95adea4..691e09a57 100644 --- a/src/Prowlarr.Api.V1/ProviderResource.cs +++ b/src/Prowlarr.Api.V1/ProviderResource.cs @@ -39,8 +39,9 @@ namespace Prowlarr.Api.V1 Fields = SchemaBuilder.ToSchema(definition.Settings), //prowlarr/supported#{0} are custom build redirect pages; if passing a new var, create a new redirect + // note: indexers get a different link InfoLink = string.Format("https://wiki.servarr.com/prowlarr/supported#{0}", - definition.Implementation.ToLower()) + definition.Implementation.ToLower().Replace(' ', '-')) }; }