();
+ try
+ {
+ var status = SonarrApi.SystemStatus(sonarrSettings.ApiKey, sonarrSettings.FullUri);
+ return status != null
+ ? Response.AsJson(new JsonResponseModel { Result = true, Message = "Connected to Sonarr successfully!" })
+ : Response.AsJson(new JsonResponseModel { Result = false, Message = "Could not connect to Sonarr, please check your settings." });
+
+ }
+ catch (ApplicationException e) // Exceptions are expected if we cannot connect so we will just log and swallow them.
+ {
+ Log.Warn("Exception thrown when attempting to get Sonarr's status: ");
+ Log.Warn(e);
+ var message = $"Could not connect to Sonarr, please check your settings. Exception Message: {e.Message}";
+ if (e.InnerException != null)
+ {
+ message = $"Could not connect to Sonarr, please check your settings. Exception Message: {e.InnerException.Message}";
+ }
+ return Response.AsJson(new JsonResponseModel { Result = false, Message = message });
+ }
+ }
}
}
\ No newline at end of file
diff --git a/PlexRequests.UI/Views/Admin/CouchPotato.cshtml b/PlexRequests.UI/Views/Admin/CouchPotato.cshtml
index a9ae695c0..b20787ced 100644
--- a/PlexRequests.UI/Views/Admin/CouchPotato.cshtml
+++ b/PlexRequests.UI/Views/Admin/CouchPotato.cshtml
@@ -85,10 +85,6 @@
}
});
});
-
-
-
-
-
+
});
\ No newline at end of file
diff --git a/PlexRequests.UI/Views/Admin/Sonarr.cshtml b/PlexRequests.UI/Views/Admin/Sonarr.cshtml
index 60c490a91..f63e58a0b 100644
--- a/PlexRequests.UI/Views/Admin/Sonarr.cshtml
+++ b/PlexRequests.UI/Views/Admin/Sonarr.cshtml
@@ -74,6 +74,12 @@
+
+