public EmptyResult Edit(SeriesModel seriesModel) { var series = _seriesProvider.GetSeries(seriesModel.SeriesId); series.Monitored = seriesModel.Monitored; series.SeasonFolder = seriesModel.SeasonFolder; series.QualityProfileId = seriesModel.QualityProfileId; var oldPath = series.Path; series.Path = seriesModel.Path; series.BacklogSetting = (BacklogSettingType)seriesModel.BacklogSetting; if (!String.IsNullOrWhiteSpace(seriesModel.CustomStartDate)) { series.CustomStartDate = DateTime.Parse(seriesModel.CustomStartDate, null, DateTimeStyles.RoundtripKind); } else { series.CustomStartDate = null; } _seriesProvider.UpdateSeries(series); if (oldPath != series.Path) { _jobProvider.QueueJob(typeof(DiskScanJob), new { SeriesId = series.SeriesId }); } return(new EmptyResult()); }
public JsonResult RunJob(string typeName) { if (!_jobProvider.QueueJob(typeName)) { return(JsonNotificationResult.Oops("Invalid Job Name")); } return(JsonNotificationResult.Info("Job Queued")); }
public JsonResult Redownload(int historyId, int episodeId) { //Delete the existing item from history _historyProvider.Delete(historyId); //Queue a job to download the replacement episode _jobProvider.QueueJob(typeof(EpisodeSearchJob), new { EpisodeId = episodeId }); return(JsonNotificationResult.Queued("Episode search")); }
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 Search(int episodeId) { _jobProvider.QueueJob(typeof(EpisodeSearchJob), new { EpisodeId = episodeId }); return(JsonNotificationResult.Queued("Episode search")); }
public JsonResult RssSync() { _jobProvider.QueueJob(typeof(RssSyncJob)); return(JsonNotificationResult.Queued("RSS sync")); }
public ActionResult StartUpdate() { _jobProvider.QueueJob(typeof(AppUpdateJob)); return(JsonNotificationResult.Info("Update will begin shortly", "NzbDrone will restart automatically.")); }