mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Naming config fixed, with integration tests
This commit is contained in:
@@ -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>();
|
||||
|
Reference in New Issue
Block a user