mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-20 21:55:03 -04:00
WIP UI Update for adding lists.
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
using NzbDrone.Core.NetImport;
|
||||
using NzbDrone.Api.ClientSchema;
|
||||
using NzbDrone.Core.NetImport;
|
||||
using NzbDrone.Core.Profiles;
|
||||
|
||||
namespace NzbDrone.Api.NetImport
|
||||
{
|
||||
public class NetImportModule : ProviderModuleBase<NetImportResource, INetImport, NetImportDefinition>
|
||||
{
|
||||
public NetImportModule(NetImportFactory indexerFactory)
|
||||
private readonly IProfileService _profileService;
|
||||
public NetImportModule(NetImportFactory indexerFactory, IProfileService profileService)
|
||||
: base(indexerFactory, "netimport")
|
||||
{
|
||||
_profileService = profileService;
|
||||
}
|
||||
|
||||
protected override void MapToResource(NetImportResource resource, NetImportDefinition definition)
|
||||
@@ -14,6 +18,20 @@ namespace NzbDrone.Api.NetImport
|
||||
base.MapToResource(resource, definition);
|
||||
|
||||
resource.Enabled = definition.Enabled;
|
||||
Field theField = null;
|
||||
int index = 0;
|
||||
foreach (var field in resource.Fields)
|
||||
{
|
||||
if (field.Label == "Quality")
|
||||
{
|
||||
index = resource.Fields.FindIndex(f => f.Label == field.Label);
|
||||
field.SelectOptions =
|
||||
_profileService.All().ConvertAll(p => new SelectOption {Name = p.Name, Value = p.Id});
|
||||
|
||||
theField = field;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void MapToModel(NetImportDefinition definition, NetImportResource resource)
|
||||
|
||||
Reference in New Issue
Block a user