mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
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
36 lines
900 B
C#
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('&');
|
|
}
|
|
}
|
|
}
|