1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-24 16:51:58 +00:00

Series Editor backend cleanup

This commit is contained in:
Mark McDowall 2012-09-19 00:32:34 -07:00
parent 3061219367
commit d9d9027022
3 changed files with 16 additions and 5 deletions

View file

@ -170,19 +170,30 @@ public ActionResult Editor()
masterBacklogList.Insert(0, new KeyValuePair<int, string>(-10, "Select..."));
ViewData["MasterBacklogSettingSelectList"] = new SelectList(masterBacklogList, "Key", "Value");
var series = _seriesProvider.GetAllSeries().OrderBy(o => SortHelper.SkipArticles(o.Title));
var series = GetSeriesModels(_seriesProvider.GetAllSeries()).OrderBy(o => SortHelper.SkipArticles(o.Title));
return View(series);
}
[HttpPost]
public JsonResult Editor(List<Series> series)
public JsonResult Editor(List<SeriesModel> series)
{
//Save edits
if (series == null || series.Count == 0)
return JsonNotificationResult.Oops("Invalid post data");
_seriesProvider.UpdateFromSeriesEditor(series);
_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,
DownloadEpisodesAiredAfter = String.IsNullOrWhiteSpace(s.DownloadEpisodesAiredAfter) ? (DateTime?)null
: DateTime.Parse(s.DownloadEpisodesAiredAfter, null, DateTimeStyles.RoundtripKind)
}
).ToList());
return JsonNotificationResult.Info("Series Mass Edit Saved");
}

View file

@ -1,5 +1,5 @@
@using NzbDrone.Web.Helpers
@model IEnumerable<NzbDrone.Core.Repository.Series>
@model IEnumerable<NzbDrone.Web.Models.SeriesModel>
@{ViewBag.Title = "Series Editor";}
@section HeaderContent

View file

@ -1,4 +1,4 @@
@model NzbDrone.Core.Repository.Series
@model NzbDrone.Web.Models.SeriesModel
@using NzbDrone.Core.Model
@using NzbDrone.Core.Repository.Quality
@using NzbDrone.Web.Helpers