mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-29 17:15:34 +01:00
New: NetImport Lists Grouped by Type
Co-Authored-By: ta264 <ta264@users.noreply.github.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace NzbDrone.Core.NetImport
|
||||
bool Enabled { get; }
|
||||
bool EnableAuto { get; }
|
||||
|
||||
NetImportType ListType { get; }
|
||||
NetImportFetchResult Fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
8
src/NzbDrone.Core/NetImport/NetImportType.cs
Normal file
8
src/NzbDrone.Core/NetImport/NetImportType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace NzbDrone.Core.NetImport
|
||||
{
|
||||
public enum NetImportType
|
||||
{
|
||||
TMDB,
|
||||
Other
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user