mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Made the feedback from Sonarr better when Sonarr already has the series #85
This commit is contained in:
parent
5843dee2a5
commit
fe0f6873e5
8 changed files with 66 additions and 19 deletions
|
@ -131,7 +131,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"
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ namespace PlexRequests.UI.Modules
|
|||
if (sonarr.Enabled)
|
||||
{
|
||||
var result = sender.SendToSonarr(sonarr, r);
|
||||
if (result != null)
|
||||
if (!string.IsNullOrEmpty(result?.title))
|
||||
{
|
||||
r.Approved = true;
|
||||
updatedRequests.Add(r);
|
||||
|
@ -284,6 +284,7 @@ namespace PlexRequests.UI.Modules
|
|||
else
|
||||
{
|
||||
Log.Error("Could not approve and send the TV {0} to Sonarr!", r.Title);
|
||||
Log.Error("Error message: {0}", result?.ErrorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -371,18 +371,19 @@ namespace PlexRequests.UI.Modules
|
|||
if (sonarrSettings.Enabled)
|
||||
{
|
||||
var result = sender.SendToSonarr(sonarrSettings, model);
|
||||
if (result != null)
|
||||
if (result != null && !string.IsNullOrEmpty(result.title))
|
||||
{
|
||||
model.Approved = true;
|
||||
Log.Debug("Adding tv to database requests (No approval required & Sonarr)");
|
||||
RequestService.AddRequest(model);
|
||||
var notify1 = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
|
||||
NotificationService.Publish(notify1);
|
||||
|
||||
return Response.AsJson(new JsonResponseModel { Result = true, Message = $"{fullShowName} was successfully added!" });
|
||||
}
|
||||
var notify1 = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
|
||||
NotificationService.Publish(notify1);
|
||||
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something went wrong adding the movie to Sonarr! Please check your settings." });
|
||||
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = result?.ErrorMessage ?? "Something went wrong adding the movie to Sonarr! Please check your settings." });
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue