New: NetImport Lists Grouped by Type

Co-Authored-By: ta264 <ta264@users.noreply.github.com>
This commit is contained in:
Qstick
2019-11-02 15:43:45 -04:00
parent d76423a305
commit ba83c01b6c
15 changed files with 65 additions and 19 deletions

View File

@@ -72,6 +72,7 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity<NetImportDefinition>("NetImport").RegisterModel()
.Ignore(x => x.ImplementationName)
.Ignore(i => i.ListType)
.Ignore(i => i.Enable);
Mapper.Entity<NotificationDefinition>("Notifications").RegisterModel()

View File

@@ -8,6 +8,8 @@ namespace NzbDrone.Core.NetImport.CouchPotato
public class CouchPotatoImport : HttpNetImportBase<CouchPotatoSettings>
{
public override string Name => "CouchPotato";
public override NetImportType ListType => NetImportType.Other;
public override bool Enabled => true;
public override bool EnableAuto => false;

View File

@@ -7,6 +7,7 @@ namespace NzbDrone.Core.NetImport
bool Enabled { get; }
bool EnableAuto { get; }
NetImportType ListType { get; }
NetImportFetchResult Fetch();
}
}

View File

@@ -23,6 +23,8 @@ namespace NzbDrone.Core.NetImport
protected readonly Logger _logger;
public abstract string Name { get; }
public abstract NetImportType ListType { get; }
public abstract bool Enabled { get; }
public abstract bool EnableAuto { get; }

View File

@@ -18,5 +18,7 @@ namespace NzbDrone.Core.NetImport
public int ProfileId { get; set; }
public string RootFolderPath { get; set; }
public override bool Enable => Enabled;
public NetImportType ListType { get; set; }
}
}

View File

@@ -39,6 +39,8 @@ namespace NzbDrone.Core.NetImport
public override void SetProviderCharacteristics(INetImport provider, NetImportDefinition definition)
{
base.SetProviderCharacteristics(provider, definition);
definition.ListType = provider.ListType;
}
public List<INetImport> Enabled()

View File

@@ -0,0 +1,8 @@
namespace NzbDrone.Core.NetImport
{
public enum NetImportType
{
TMDB,
Other
}
}

View File

@@ -10,6 +10,8 @@ namespace NzbDrone.Core.NetImport.RSSImport
public class RSSImport : HttpNetImportBase<RSSImportSettings>
{
public override string Name => "RSSList";
public override NetImportType ListType => NetImportType.Other;
public override bool Enabled => true;
public override bool EnableAuto => false;

View File

@@ -11,6 +11,8 @@ namespace NzbDrone.Core.NetImport.Radarr
public class RadarrLists : HttpNetImportBase<RadarrSettings>
{
public override string Name => "Radarr Lists";
public override NetImportType ListType => NetImportType.Other;
public override bool Enabled => true;
public override bool EnableAuto => false;

View File

@@ -8,6 +8,8 @@ namespace NzbDrone.Core.NetImport.StevenLu
public class StevenLuImport : HttpNetImportBase<StevenLuSettings>
{
public override string Name => "StevenLu";
public override NetImportType ListType => NetImportType.Other;
public override bool Enabled => true;
public override bool EnableAuto => false;

View File

@@ -9,6 +9,8 @@ namespace NzbDrone.Core.NetImport.TMDb
public class TMDbImport : HttpNetImportBase<TMDbSettings>
{
public override string Name => "TMDb Lists";
public override NetImportType ListType => NetImportType.TMDB;
public override bool Enabled => true;
public override bool EnableAuto => false;

View File

@@ -11,6 +11,8 @@ namespace NzbDrone.Core.NetImport.Trakt
public class TraktImport : HttpNetImportBase<TraktSettings>
{
public override string Name => "Trakt List";
public override NetImportType ListType => NetImportType.Other;
public override bool Enabled => true;
public override bool EnableAuto => false;

View File

@@ -11,6 +11,8 @@ namespace Radarr.Api.V3.NetImport
public string RootFolderPath { get; set; }
public int QualityProfileId { get; set; }
public MovieStatusType MinimumAvailability { get; set; }
public NetImportType ListType { get; set; }
public int ListOrder { get; set; }
}
public class NetImportResourceMapper : ProviderResourceMapper<NetImportResource, NetImportDefinition>
@@ -30,6 +32,8 @@ namespace Radarr.Api.V3.NetImport
resource.RootFolderPath = definition.RootFolderPath;
resource.QualityProfileId = definition.ProfileId;
resource.MinimumAvailability = definition.MinimumAvailability;
resource.ListType = definition.ListType;
resource.ListOrder = (int)definition.ListType;
return resource;
}
@@ -49,6 +53,7 @@ namespace Radarr.Api.V3.NetImport
definition.RootFolderPath = resource.RootFolderPath;
definition.ProfileId = resource.QualityProfileId;
definition.MinimumAvailability = resource.MinimumAvailability;
definition.ListType = resource.ListType;
return definition;
}