Basic Application Syncing

This commit is contained in:
Qstick
2020-10-22 14:00:04 -04:00
parent 47fbab02c5
commit feba96e8e0
16 changed files with 363 additions and 31 deletions
@@ -1,13 +1,18 @@
using System;
using System.Collections.Generic;
using FluentValidation.Results;
using NLog;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Applications
{
public abstract class ApplicationBase<TSettings> : IApplications
public abstract class ApplicationBase<TSettings> : IApplication
where TSettings : IProviderConfig, new()
{
protected readonly IAppIndexerMapService _appIndexerMapService;
protected readonly Logger _logger;
public abstract string Name { get; }
public Type ConfigContract => typeof(TSettings);
@@ -19,6 +24,12 @@ namespace NzbDrone.Core.Applications
protected TSettings Settings => (TSettings)Definition.Settings;
public ApplicationBase(IAppIndexerMapService appIndexerMapService, Logger logger)
{
_appIndexerMapService = appIndexerMapService;
_logger = logger;
}
public override string ToString()
{
return GetType().Name;
@@ -40,6 +51,11 @@ namespace NzbDrone.Core.Applications
}
}
public abstract void AddIndexer(IndexerDefinition indexer);
public abstract void UpdateIndexer(IndexerDefinition indexer);
public abstract void RemoveIndexer(int indexerId);
public abstract void SyncIndexers();
public virtual object RequestAction(string action, IDictionary<string, string> query)
{
return null;