2021-10-21 20:04:19 +00:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2018-11-23 07:03:32 +00:00
|
|
|
using NzbDrone.Core.Profiles;
|
|
|
|
using Radarr.Http;
|
|
|
|
|
2019-12-03 01:36:18 +00:00
|
|
|
namespace Radarr.Api.V3.Profiles.Quality
|
2018-11-23 07:03:32 +00:00
|
|
|
{
|
2021-10-21 20:04:19 +00:00
|
|
|
[V3ApiController("qualityprofile/schema")]
|
|
|
|
public class QualityProfileSchemaController : Controller
|
2018-11-23 07:03:32 +00:00
|
|
|
{
|
2019-06-11 02:59:39 +00:00
|
|
|
private readonly IProfileService _profileService;
|
2018-11-23 07:03:32 +00:00
|
|
|
|
2021-10-21 20:04:19 +00:00
|
|
|
public QualityProfileSchemaController(IProfileService profileService)
|
2018-11-23 07:03:32 +00:00
|
|
|
{
|
2019-06-11 02:59:39 +00:00
|
|
|
_profileService = profileService;
|
2018-11-23 07:03:32 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 20:04:19 +00:00
|
|
|
[HttpGet]
|
|
|
|
public QualityProfileResource GetSchema()
|
2018-11-23 07:03:32 +00:00
|
|
|
{
|
2019-06-11 02:59:39 +00:00
|
|
|
var qualityProfile = _profileService.GetDefaultProfile(string.Empty);
|
2018-11-23 07:03:32 +00:00
|
|
|
|
2019-06-11 02:59:39 +00:00
|
|
|
return qualityProfile.ToResource();
|
2018-11-23 07:03:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|