mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 05:47:22 -04:00
New: Set default names for providers in Add Modals
This commit is contained in:
parent
b3a541c9ff
commit
3b5f151252
9 changed files with 21 additions and 33 deletions
|
@ -40,6 +40,10 @@ interface Indexer extends ModelBase {
|
|||
added: Date;
|
||||
enable: boolean;
|
||||
redirect: boolean;
|
||||
supportsRss: boolean;
|
||||
supportsSearch: boolean;
|
||||
supportsRedirect: boolean;
|
||||
supportsPagination: boolean;
|
||||
protocol: string;
|
||||
privacy: string;
|
||||
priority: number;
|
||||
|
@ -49,6 +53,7 @@ interface Indexer extends ModelBase {
|
|||
status: IndexerStatus;
|
||||
capabilities: IndexerCapabilities;
|
||||
indexerUrls: string[];
|
||||
legacyUrls: string[];
|
||||
}
|
||||
|
||||
export default Indexer;
|
||||
|
|
|
@ -117,10 +117,7 @@ export default {
|
|||
|
||||
[SELECT_APPLICATION_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
selectedSchema.onGrab = selectedSchema.supportsOnGrab;
|
||||
selectedSchema.onDownload = selectedSchema.supportsOnDownload;
|
||||
selectedSchema.onUpgrade = selectedSchema.supportsOnUpgrade;
|
||||
selectedSchema.onRename = selectedSchema.supportsOnRename;
|
||||
selectedSchema.name = selectedSchema.implementationName;
|
||||
|
||||
return selectedSchema;
|
||||
});
|
||||
|
|
|
@ -142,6 +142,7 @@ export default {
|
|||
|
||||
[SELECT_DOWNLOAD_CLIENT_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
selectedSchema.name = selectedSchema.implementationName;
|
||||
selectedSchema.enable = true;
|
||||
|
||||
return selectedSchema;
|
||||
|
|
|
@ -104,6 +104,8 @@ export default {
|
|||
|
||||
[SELECT_INDEXER_PROXY_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
selectedSchema.name = selectedSchema.implementationName;
|
||||
|
||||
return selectedSchema;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -104,6 +104,7 @@ export default {
|
|||
|
||||
[SELECT_NOTIFICATION_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
selectedSchema.name = selectedSchema.implementationName;
|
||||
selectedSchema.onGrab = selectedSchema.supportsOnGrab;
|
||||
selectedSchema.onApplicationUpdate = selectedSchema.supportsOnApplicationUpdate;
|
||||
|
||||
|
|
|
@ -13,6 +13,15 @@ export interface Field {
|
|||
interface Notification extends ModelBase {
|
||||
enable: boolean;
|
||||
name: string;
|
||||
onGrab: boolean;
|
||||
onHealthIssue: boolean;
|
||||
onHealthRestored: boolean;
|
||||
includeHealthWarnings: boolean;
|
||||
onApplicationUpdate: boolean;
|
||||
supportsOnGrab: boolean;
|
||||
supportsOnHealthIssue: boolean;
|
||||
supportsOnHealthRestored: boolean;
|
||||
supportsOnApplicationUpdate: boolean;
|
||||
fields: Field[];
|
||||
implementationName: string;
|
||||
implementation: string;
|
||||
|
|
|
@ -46,7 +46,6 @@ namespace NzbDrone.Core.Applications
|
|||
|
||||
yield return new ApplicationDefinition
|
||||
{
|
||||
Name = GetType().Name,
|
||||
SyncLevel = ApplicationSyncLevel.FullSync,
|
||||
Implementation = GetType().Name,
|
||||
Settings = config
|
||||
|
|
|
@ -27,20 +27,7 @@ namespace NzbDrone.Core.Download
|
|||
|
||||
public virtual ProviderMessage Message => null;
|
||||
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
{
|
||||
var config = (IProviderConfig)new TSettings();
|
||||
|
||||
yield return new DownloadClientDefinition
|
||||
{
|
||||
Name = GetType().Name,
|
||||
Implementation = GetType().Name,
|
||||
Settings = config
|
||||
};
|
||||
}
|
||||
}
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions => new List<ProviderDefinition>();
|
||||
|
||||
public ProviderDefinition Definition { get; set; }
|
||||
|
||||
|
|
|
@ -14,20 +14,7 @@ namespace NzbDrone.Core.IndexerProxies
|
|||
|
||||
public Type ConfigContract => typeof(TSettings);
|
||||
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
{
|
||||
var config = (IProviderConfig)new TSettings();
|
||||
|
||||
yield return new IndexerProxyDefinition
|
||||
{
|
||||
Name = GetType().Name,
|
||||
Implementation = GetType().Name,
|
||||
Settings = config
|
||||
};
|
||||
}
|
||||
}
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions => new List<ProviderDefinition>();
|
||||
|
||||
public ProviderDefinition Definition { get; set; }
|
||||
public abstract ValidationResult Test();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue