merge in tidusjar's dev changes, remove approve all, fix alignment on approve all category buttons

This commit is contained in:
Drewster727 2016-03-29 09:03:34 -05:00
commit dce5983720
26 changed files with 592 additions and 109 deletions

View file

@ -133,7 +133,7 @@ namespace PlexRequests.UI.Modules
return Response.AsJson(new JsonResponseModel
{
Result = false,
Message = "Could not add the series to Sonarr"
Message = result.ErrorMessage ?? "Could not add the series to Sonarr"
});
}
@ -340,7 +340,7 @@ namespace PlexRequests.UI.Modules
if (sonarr.Enabled)
{
var res = sender.SendToSonarr(sonarr, r);
if (res != null)
if (!string.IsNullOrEmpty(res?.title))
{
r.Approved = true;
updatedRequests.Add(r);
@ -348,15 +348,25 @@ namespace PlexRequests.UI.Modules
else
{
Log.Error("Could not approve and send the TV {0} to Sonarr!", r.Title);
Log.Error("Error message: {0}", res?.ErrorMessage);
}
}
}
}
var result = Service.BatchUpdate(updatedRequests);
try
{
var result = Service.BatchUpdate(updatedRequests);
return Response.AsJson(result
? new JsonResponseModel { Result = true }
: new JsonResponseModel { Result = false, Message = "We could not approve all of the requests. Please try again or check the logs." });
}
catch (Exception e)
{
Log.Fatal(e);
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something bad happened, please check the logs!" });
}
}
private bool SendMovie(CouchPotatoSettings settings, RequestedModel r, ICouchPotatoApi cp)
{