Work on the TV request. the latest parameter is not being passed into the requestTvshow

This commit is contained in:
tidusjar 2016-02-29 17:30:01 +00:00
parent 3d6da12fb5
commit 70362b908f
5 changed files with 73 additions and 15 deletions

View file

@ -37,7 +37,7 @@ namespace RequestPlex.UI.Modules
Post["search/request/tv"] = parameters =>
{
var tvShowId = (int)Request.Form.tvId;
var latest = (bool)Request.Form.latestSeason;
var latest = (bool)Request.Form.latest;
return RequestTvShow(tvShowId, latest);
};
}
@ -94,6 +94,10 @@ namespace RequestPlex.UI.Modules
{
// Latest send to Sonarr and no need to store in DB
var s = new SettingsService();
if (s.CheckRequest(showId))
{
return Response.AsJson(new { Result = false, Message = "TV Show has already been requested!" });
}
s.AddRequest(showId, RequestType.TvShow);
return Response.AsJson(new {Result = true });
}