lidarr/src/NzbDrone.Api/Profiles/LegacyProfileModule.cs
Mark McDowall 74a38415cf Profiles
Indexes are created with the same uniqueness when copying a table

New: Non-English episode support
New: Renamed Quality Profiles to Profiles and made them more powerful
New: Configurable wait time before grabbing a release to wait for a better quality
2014-07-25 23:21:44 -07:00

36 lines
900 B
C#

using System;
using System.Text;
using Nancy;
using Nancy.Responses;
namespace NzbDrone.Api.Profiles
{
class LegacyProfileModule : NzbDroneApiModule
{
public LegacyProfileModule()
: base("qualityprofile")
{
Get["/"] = x =>
{
string queryString = ConvertQueryParams(Request.Query);
var url = String.Format("/api/profile?{0}", queryString);
return Response.AsRedirect(url, RedirectResponse.RedirectType.Permanent);
};
}
private string ConvertQueryParams(DynamicDictionary query)
{
var sb = new StringBuilder();
foreach (var key in query)
{
var value = query[key];
sb.AppendFormat("&{0}={1}", key, value);
}
return sb.ToString().Trim('&');
}
}
}