public JsonResult LookupSeries(string term) { try { var tvDbResults = _tvDbProvider.SearchSeries(term).Select(r => new TvDbSearchResultModel { Id = r.Id, Title = r.SeriesName, DisplayedTitle = r.FirstAired.Year > 1900 && !r.SeriesName.EndsWith("(" + r.FirstAired.Year + ")") ? string.Format("{0} ({1})", r.SeriesName, r.FirstAired.Year) : r.SeriesName, Banner = r.Banner.BannerPath, Url = String.Format("http://www.thetvdb.com/?tab=series&id={0}", r.Id) }).ToList(); return(Json(tvDbResults, JsonRequestBehavior.AllowGet)); } catch (TvdbNotAvailableException ex) { logger.WarnException("Unable to lookup series on TheTVDB", ex); return(JsonNotificationResult.Info("Lookup Failed", "TheTVDB is not available at this time.")); } catch (Exception ex) { logger.WarnException("Unknown Error when looking up series on TheTVDB", ex); return(JsonNotificationResult.Info("Lookup Failed", "Unknown error while connecting to TheTVDB")); } }
public JsonResult Delete(int historyId) { //Delete the existing item from history _historyProvider.Delete(historyId); return(JsonNotificationResult.Info("History Item Deleted")); }
public JsonResult TestEmail(string server, int port, bool ssl, string username, string password, string fromAddress, string toAddresses) { if (_smtpProvider.SendTestEmail(server, port, ssl, username, password, fromAddress, toAddresses)) { return(JsonNotificationResult.Info("Successful", "Test email sent.")); } return(JsonNotificationResult.Oops("Couldn't send Email, please check your settings")); }
public JsonResult RunJob(string typeName) { if (!_jobProvider.QueueJob(typeName)) { return(JsonNotificationResult.Oops("Invalid Job Name")); } return(JsonNotificationResult.Info("Job Queued")); }
public JsonResult VerifyTwitterAuthorization(string token, string verifier) { var result = _twitterProvider.GetAndSaveAccessToken(token, verifier); if (!result) { JsonNotificationResult.Oops("Couldn't verify Twitter Authorization"); } return(JsonNotificationResult.Info("Good News!", "Successfully verified Twitter Authorization.")); }
public JsonResult TestNzbget(string host, int port, string username, string password) { //_prowlProvider.TestNotification(apiKeys); var version = _nzbgetProvider.Test(host, port, username, password); if (String.IsNullOrWhiteSpace(version)) { return(JsonNotificationResult.Oops("Failed to connect to Nzbget, please check your settings")); } return(JsonNotificationResult.Info("Success!", "Nzbget settings have been verified successfully! Version: " + version)); }
public JsonResult TestXbmcJsonApi(string hosts, string username, string password) { try { _xbmcProvider.TestJsonApi(hosts, username, password); return(JsonNotificationResult.Info("Success!", "Successfully tested JSON API")); } catch (Exception) { } return(JsonNotificationResult.Oops("Failed to test JSON API, please review your settings.")); }
public JsonResult TestXbmcNotification(string hosts) { try { _xbmcProvider.TestNotification(hosts); return(JsonNotificationResult.Info("Success!", "Test Notification sent successfully")); } catch (Exception) { } return(JsonNotificationResult.Oops("Failed to send test notification, please review your settings.")); }
public JsonResult SaveRootDir(string path) { if (String.IsNullOrWhiteSpace(path)) { JsonNotificationResult.Error("Can't add root folder", "Path can not be empty"); } _rootFolderProvider.Add(new RootDir { Path = path }); return(JsonNotificationResult.Info("Root Folder saved", "Root folder saved successfully.")); }
public JsonResult TestPlexServer(string host) { try { _plexProvider.GetSectionKeys(host); return(JsonNotificationResult.Info("Success!", "Successfully tested Server settings")); } catch (Exception) { } return(JsonNotificationResult.Oops("Failed to connect to server, please review your settings.")); }
public JsonResult TestPlexNotification(string hosts, string username, string password) { try { _plexProvider.TestNotification(hosts, username, password); return(JsonNotificationResult.Info("Success!", "Test Notification sent successfully")); } catch (Exception) { } return(JsonNotificationResult.Oops("Failed to send test notification, please review your settings.")); }
public JsonResult RegisterGrowl(string host, string password) { try { var split = host.Split(':'); var hostname = split[0]; var port = Convert.ToInt32(split[1]); _growlProvider.Register(hostname, port, password); _growlProvider.TestNotification(hostname, port, password); return(JsonNotificationResult.Info("Good News!", "Registered and tested growl successfully")); } catch (Exception ex) { logger.TraceException(ex.Message, ex); return(JsonNotificationResult.Oops("Couldn't register and test Growl")); } }
public JsonResult AddExistingSeries(string path, string seriesName, int seriesId, int qualityProfileId, string startDate) { if (seriesId == 0 || String.IsNullOrWhiteSpace(seriesName)) { return(JsonNotificationResult.Error("Add Existing series failed.", "Invalid Series information")); } DateTime?date = null; if (!String.IsNullOrWhiteSpace(startDate)) { date = DateTime.Parse(startDate, null, DateTimeStyles.RoundtripKind); } _seriesProvider.AddSeries(seriesName, path, seriesId, qualityProfileId, date); _jobProvider.QueueJob(typeof(ImportNewSeriesJob)); return(JsonNotificationResult.Info(seriesName, "Was added successfully")); }
public JsonResult Editor(List <SeriesModel> series) { //Save edits if (series == null || series.Count == 0) { return(JsonNotificationResult.Oops("Invalid post data")); } _seriesProvider.UpdateFromSeriesEditor(series.Select(s => new Series { SeriesId = s.SeriesId, QualityProfileId = s.QualityProfileId, Monitored = s.Monitored, SeasonFolder = s.SeasonFolder, BacklogSetting = (BacklogSettingType)s.BacklogSetting, Path = s.Path, CustomStartDate = String.IsNullOrWhiteSpace(s.CustomStartDate) ? (DateTime?)null : DateTime.Parse(s.CustomStartDate, null, DateTimeStyles.RoundtripKind) } ).ToList()); return(JsonNotificationResult.Info("Series Mass Edit Saved")); }
private JsonResult GetSuccessResult() { return(JsonNotificationResult.Info("Settings Saved")); }
public JsonResult Shutdown() { _jobProvider.QueueJob(typeof(AppShutdownJob)); return(JsonNotificationResult.Info("NzbDrone will shutdown shortly")); }
public JsonResult Restart() { _jobProvider.QueueJob(typeof(AppRestartJob)); return(JsonNotificationResult.Info("NzbDrone will restart shortly")); }
public ActionResult StartUpdate() { _jobProvider.QueueJob(typeof(AppUpdateJob)); return(JsonNotificationResult.Info("Update will begin shortly", "NzbDrone will restart automatically.")); }
public JsonResult ForceDownload(int id) { _searchHistoryProvider.ForceDownload(id); return(JsonNotificationResult.Info("Success", "Requested episode has been sent to download client")); }
public JsonResult Clear() { _logProvider.DeleteAll(); return(JsonNotificationResult.Info("Logs Cleared")); }
public JsonResult Purge() { _historyProvider.Purge(); return(JsonNotificationResult.Info("History Cleared")); }
public JsonResult Trim() { _historyProvider.Trim(); return(JsonNotificationResult.Info("Trimmed History")); }
public JsonResult TestProwl(string apiKeys) { _prowlProvider.TestNotification(apiKeys); return(JsonNotificationResult.Info("Good News!", "Test message has been sent to Prowl")); }