diff --git a/src/NzbDrone.Api/NzbDrone.Api.csproj b/src/NzbDrone.Api/NzbDrone.Api.csproj index a4f7bf194..3305a880d 100644 --- a/src/NzbDrone.Api/NzbDrone.Api.csproj +++ b/src/NzbDrone.Api/NzbDrone.Api.csproj @@ -151,6 +151,7 @@ + diff --git a/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs b/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs new file mode 100644 index 000000000..1fe0bb6ca --- /dev/null +++ b/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs @@ -0,0 +1,34 @@ +using System; +using System.Text; +using Nancy; + +namespace NzbDrone.Api.Wanted +{ + class LegacyMissingModule : NzbDroneApiModule + { + public LegacyMissingModule() : base("missing") + { + Get["/"] = x => + { + string queryString = ConvertQueryParams(Request.Query); + var url = String.Format("/api/wanted/missing?{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('&'); + } + } +}