mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
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:
@@ -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);
|
||||
|
||||
@@ -49,14 +49,6 @@ namespace NzbDrone.Web.Controllers
|
||||
_seriesProvider = seriesProvider;
|
||||
}
|
||||
|
||||
public JsonResult TestResults(string q)
|
||||
{
|
||||
var results = new List<TvDbSearchResultModel>();
|
||||
results.Add(new TvDbSearchResultModel { Id = 1, Title = "30 Rock", FirstAired = DateTime.Today.ToShortDateString() });
|
||||
results.Add(new TvDbSearchResultModel { Id = 2, Title = "The Office", FirstAired = DateTime.Today.AddDays(-1).ToShortDateString() });
|
||||
|
||||
return Json(results, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user