Fixed debugging issues. Add Series tweaks.

Add series buttons are disabled on click to prevent multiple clicks.
This commit is contained in:
Mark McDowall 2012-09-19 09:18:03 -07:00
parent bd5ced1540
commit 15e4a286d1
15 changed files with 225 additions and 185 deletions

View file

@ -44,11 +44,9 @@ namespace NzbDrone.Web.Controllers
_diskProvider = diskProvider;
}
[HttpPost]
public EmptyResult ScanNewSeries()
public ActionResult Index()
{
_jobProvider.QueueJob(typeof(ImportNewSeriesJob));
return new EmptyResult();
return View();
}
public ActionResult AddNew()
@ -67,11 +65,6 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult Index()
{
return View();
}
public ActionResult ExistingSeries()
{
var result = new ExistingSeriesModel();
@ -144,52 +137,11 @@ namespace NzbDrone.Web.Controllers
date = DateTime.Parse(airedAfter, null, DateTimeStyles.RoundtripKind);
_seriesProvider.AddSeries(seriesName,path, seriesId, qualityProfileId, date);
ScanNewSeries();
_jobProvider.QueueJob(typeof(ImportNewSeriesJob));
return JsonNotificationResult.Info(seriesName, "Was added successfully");
}
[HttpPost]
public JsonResult QuickAddNewSeries(string seriesName, int seriesId, int qualityProfileId)
{
var path = _rootFolderProvider.GetMostFreeRootDir();
path = Path.Combine(path, MediaFileProvider.CleanFilename(seriesName));
//Create the folder for the new series
//Use the created folder name when adding the series
path = _diskProvider.CreateDirectory(path);
return AddExistingSeries(path, seriesName, seriesId, qualityProfileId, null);
}
[ChildActionOnly]
public ActionResult QuickAdd()
{
var defaultQuality = _configProvider.DefaultQualityProfile;
var qualityProfiles = _qualityProvider.All();
ViewData["qualityProfiles"] = new SelectList(
qualityProfiles,
"QualityProfileId",
"Name",
defaultQuality);
return PartialView();
}
[HttpPost]
[JsonErrorFilter]
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.");
}
[HttpGet]
public JsonResult LookupSeries(string term)
{
@ -234,6 +186,18 @@ namespace NzbDrone.Web.Controllers
return PartialView("RootDir");
}
[HttpPost]
[JsonErrorFilter]
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.");
}
[JsonErrorFilter]
public JsonResult DeleteRootDir(string path)
{