Fixed: Fixed styling for add series dropdown

Fixed: Adding a series is now blocked unless a valid root folder is provided
This commit is contained in:
kay.one 2012-02-26 19:25:57 -08:00
parent a4c433c5b2
commit 9669869c9b
6 changed files with 14 additions and 23 deletions

View file

@ -105,6 +105,9 @@ namespace NzbDrone.Web.Controllers
[HttpPost]
public JsonResult AddNewSeries(string path, string seriesName, int seriesId, int qualityProfileId)
{
if (string.IsNullOrWhiteSpace(path) || String.Equals(path,"null",StringComparison.InvariantCultureIgnoreCase))
return JsonNotificationResult.Error("Couldn't add " + seriesName, "You need a valid root folder");
path = Path.Combine(path, MediaFileProvider.CleanFilename(seriesName));
//Create the folder for the new series
@ -174,8 +177,10 @@ namespace NzbDrone.Web.Controllers
var tvDbResults = _tvDbProvider.SearchSeries(term).Select(r => new TvDbSearchResultModel
{
Id = r.Id,
Title = r.SeriesName,
FirstAired = r.FirstAired.ToShortDateString()
Title = r.FirstAired.Year > 1900
?string.Format("{0} ({1})", r.SeriesName, r.FirstAired.Year)
:r.SeriesName,
Banner = r.Banner.BannerPath
}).ToList();
return Json(tvDbResults, JsonRequestBehavior.AllowGet);