mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Show definition name on add/edit screen for Cardigann
This commit is contained in:
@@ -39,6 +39,7 @@ function EditIndexerModalContent(props) {
|
|||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
implementationName,
|
implementationName,
|
||||||
|
definitionName,
|
||||||
name,
|
name,
|
||||||
enable,
|
enable,
|
||||||
redirect,
|
redirect,
|
||||||
@@ -50,10 +51,12 @@ function EditIndexerModalContent(props) {
|
|||||||
priority
|
priority
|
||||||
} = item;
|
} = item;
|
||||||
|
|
||||||
|
const indexerDisplayName = implementationName === definitionName ? implementationName : `${implementationName} (${definitionName})`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
{`${id ? translate('EditIndexer') : translate('AddIndexer')} - ${implementationName}`}
|
{`${id ? translate('EditIndexer') : translate('AddIndexer')} - ${indexerDisplayName}`}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
|
@@ -36,6 +36,12 @@ function selectSettings(item, pendingChanges, saveError) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key === 'definitionName') {
|
||||||
|
result.definitionName = item[key];
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
const setting = {
|
const setting = {
|
||||||
value: item[key],
|
value: item[key],
|
||||||
errors: _.map(_.remove(validationFailures, (failure) => {
|
errors: _.map(_.remove(validationFailures, (failure) => {
|
||||||
|
@@ -15,6 +15,7 @@ namespace Prowlarr.Api.V1.Indexers
|
|||||||
public class IndexerResource : ProviderResource<IndexerResource>
|
public class IndexerResource : ProviderResource<IndexerResource>
|
||||||
{
|
{
|
||||||
public string[] IndexerUrls { get; set; }
|
public string[] IndexerUrls { get; set; }
|
||||||
|
public string DefinitionName { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string Language { get; set; }
|
public string Language { get; set; }
|
||||||
public string Encoding { get; set; }
|
public string Encoding { get; set; }
|
||||||
@@ -51,6 +52,8 @@ namespace Prowlarr.Api.V1.Indexers
|
|||||||
|
|
||||||
var resource = base.ToResource(definition);
|
var resource = base.ToResource(definition);
|
||||||
|
|
||||||
|
resource.DefinitionName = definition.ImplementationName;
|
||||||
|
|
||||||
var infoLinkName = definition.ImplementationName;
|
var infoLinkName = definition.ImplementationName;
|
||||||
|
|
||||||
if (definition.Implementation == typeof(Cardigann).Name)
|
if (definition.Implementation == typeof(Cardigann).Name)
|
||||||
@@ -71,6 +74,7 @@ namespace Prowlarr.Api.V1.Indexers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource.DefinitionName = settings.DefinitionFile;
|
||||||
infoLinkName = settings.DefinitionFile;
|
infoLinkName = settings.DefinitionFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user