mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Series Grid AJAX'd.
Edit in popup for Series Grid using custom editing template.
This commit is contained in:
parent
5c1c8466c1
commit
70bfc49b4e
9 changed files with 181 additions and 14 deletions
|
@ -43,11 +43,12 @@ namespace NzbDrone.Web.Controllers
|
|||
|
||||
public ActionResult Index()
|
||||
{
|
||||
ViewData.Model = _seriesProvider.GetAllSeries().ToList();
|
||||
var profiles = _qualityProvider.GetAllProfiles();
|
||||
ViewData["SelectList"] = new SelectList(profiles, "QualityProfileId", "Name");
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
public ActionResult RssSync()
|
||||
{
|
||||
_jobProvider.BeginExecute(typeof(RssSyncJob));
|
||||
|
@ -63,6 +64,63 @@ namespace NzbDrone.Web.Controllers
|
|||
});
|
||||
}
|
||||
|
||||
[GridAction]
|
||||
public ActionResult _AjaxSeriesGrid()
|
||||
{
|
||||
var series = new List<SeriesModel>();
|
||||
var seriesInDb = _seriesProvider.GetAllSeries().ToList();
|
||||
|
||||
seriesInDb.ForEach(s => series.Add(new SeriesModel
|
||||
{
|
||||
SeriesId = s.SeriesId,
|
||||
Title = s.Title,
|
||||
AirsDayOfWeek = s.AirsDayOfWeek.ToString(),
|
||||
Monitored = s.Monitored,
|
||||
Overview = s.Overview,
|
||||
Path = s.Path,
|
||||
QualityProfileId = s.QualityProfileId,
|
||||
QualityProfileName = s.QualityProfile.Name,
|
||||
SeasonsCount = s.Seasons.Count,
|
||||
SeasonFolder = s.SeasonFolder,
|
||||
Status = s.Status
|
||||
}));
|
||||
|
||||
return View(new GridModel(series));
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
[GridAction]
|
||||
public ActionResult _SaveAjaxSeriesEditing(int id, string path, bool monitored, bool seasonFolder, int qualityProfileId)
|
||||
{
|
||||
var oldSeries = _seriesProvider.GetSeries(id);
|
||||
oldSeries.Path = path;
|
||||
oldSeries.Monitored = monitored;
|
||||
oldSeries.SeasonFolder = monitored;
|
||||
oldSeries.QualityProfileId = qualityProfileId;
|
||||
|
||||
_seriesProvider.UpdateSeries(oldSeries);
|
||||
|
||||
var series = new List<SeriesModel>();
|
||||
var seriesInDb = _seriesProvider.GetAllSeries().ToList();
|
||||
|
||||
seriesInDb.ForEach(s => series.Add(new SeriesModel
|
||||
{
|
||||
SeriesId = s.SeriesId,
|
||||
Title = s.Title,
|
||||
AirsDayOfWeek = s.AirsDayOfWeek.ToString(),
|
||||
Monitored = s.Monitored,
|
||||
Overview = s.Overview,
|
||||
Path = s.Path,
|
||||
QualityProfileId = s.QualityProfileId,
|
||||
QualityProfileName = s.QualityProfile.Name,
|
||||
SeasonsCount = s.Seasons.Count,
|
||||
SeasonFolder = s.SeasonFolder,
|
||||
Status = s.Status
|
||||
}));
|
||||
|
||||
return View(new GridModel(series));
|
||||
}
|
||||
|
||||
[GridAction]
|
||||
public ActionResult _AjaxSeasonGrid(int seasonId)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue