mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Naming config fixed, with integration tests
This commit is contained in:
parent
1e3a308917
commit
dd37713a10
7 changed files with 52 additions and 11 deletions
|
@ -22,10 +22,9 @@ namespace NzbDrone.Api.Config
|
|||
_namingConfigService = namingConfigService;
|
||||
_buildFileNames = buildFileNames;
|
||||
GetResourceSingle = GetNamingConfig;
|
||||
|
||||
GetResourceById = GetNamingConfig;
|
||||
UpdateResource = UpdateNamingConfig;
|
||||
|
||||
|
||||
Get["/samples"] = x => GetExamples(this.Bind<NamingConfigResource>());
|
||||
|
||||
SharedValidator.RuleFor(c => c.MultiEpisodeStyle).InclusiveBetween(0, 3);
|
||||
|
@ -35,7 +34,7 @@ namespace NzbDrone.Api.Config
|
|||
|
||||
private void UpdateNamingConfig(NamingConfigResource resource)
|
||||
{
|
||||
GetNewId<NamingConfig>(_namingConfigService.Save, resource);
|
||||
_namingConfigService.Save(resource.InjectTo<NamingConfig>());
|
||||
}
|
||||
|
||||
private NamingConfigResource GetNamingConfig()
|
||||
|
@ -43,6 +42,11 @@ namespace NzbDrone.Api.Config
|
|||
return _namingConfigService.GetConfig().InjectTo<NamingConfigResource>();
|
||||
}
|
||||
|
||||
private NamingConfigResource GetNamingConfig(int id)
|
||||
{
|
||||
return GetNamingConfig();
|
||||
}
|
||||
|
||||
private JsonResponse<NamingSampleResource> GetExamples(NamingConfigResource config)
|
||||
{
|
||||
var nameSpec = config.InjectTo<NamingConfig>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue