From a681024db2e4d5a9bae8737d4b5728e8d544fa01 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 8 Dec 2011 20:23:23 -0800 Subject: [PATCH] SABnzbd Auto-Configure will now display an error on failure. --- NzbDrone.Web/Controllers/SettingsController.cs | 12 ++++++++++-- NzbDrone.Web/Views/Settings/Index.cshtml | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 34d17175a..8a6c22f34 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -307,7 +307,6 @@ public JsonResult DeleteNewznabProvider(int providerId) return new JsonResult { Data = "ok" }; } - public QualityModel GetUpdatedProfileList() { var profiles = _qualityProvider.All().ToList(); @@ -323,7 +322,16 @@ public JsonResult AutoConfigureSab() try { var info = _autoConfigureProvider.AutoConfigureSab(); - return Json(info, JsonRequestBehavior.AllowGet); + + if (info != null) + return Json(info, JsonRequestBehavior.AllowGet); + + return Json(new NotificationResult + { + Title = "Auto-Configure Failed", + Text = "Please enter your SAB Settings Manually", + NotificationType = NotificationType.Error + }, JsonRequestBehavior.AllowGet); } catch (Exception) diff --git a/NzbDrone.Web/Views/Settings/Index.cshtml b/NzbDrone.Web/Views/Settings/Index.cshtml index 81a91dd41..e7e51643d 100644 --- a/NzbDrone.Web/Views/Settings/Index.cshtml +++ b/NzbDrone.Web/Views/Settings/Index.cshtml @@ -12,4 +12,4 @@ Settings
  • @Html.ActionLink("Notifications", "Notifications", "Settings")
  • @Html.ActionLink("System", "System", "Settings")
  • - + \ No newline at end of file