You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
822 B
35 lines
822 B
using System.Text;
|
|
using Nancy;
|
|
|
|
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);
|
|
};
|
|
}
|
|
|
|
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('&');
|
|
}
|
|
}
|
|
}
|