1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-20 21:55:03 -04:00

Rethought about where certain things are stored.

Profiles are now a component of the NetImportDefinition.
This commit is contained in:
Leonardo Galli
2017-01-22 17:02:20 +01:00
parent 9fffcfaea3
commit 94eccc6c14
11 changed files with 36 additions and 25 deletions
+5 -14
View File
@@ -18,19 +18,8 @@ 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 Profile")
{
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;
}
}
resource.EnableAuto = definition.EnableAuto;
resource.ProfileId = definition.ProfileId;
}
@@ -38,7 +27,9 @@ namespace NzbDrone.Api.NetImport
{
base.MapToModel(definition, resource);
resource.Enabled = definition.Enabled;
definition.Enabled = resource.Enabled;
definition.EnableAuto = resource.EnableAuto;
definition.ProfileId = resource.ProfileId;
}
protected override void Validate(NetImportDefinition definition, bool includeWarnings)