1
0
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:
Leonardo Galli
2017-01-21 22:13:55 +01:00
parent 451f2d30e4
commit dd553b9439
19 changed files with 1221 additions and 1212 deletions
+20 -2
View File
@@ -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)