From 9669869c9bb3a57eda8f24bb1baa3704508c891b Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 26 Feb 2012 19:25:57 -0800 Subject: [PATCH] Fixed: Fixed styling for add series dropdown Fixed: Adding a series is now blocked unless a valid root folder is provided --- NzbDrone.Web/Content/NzbDrone.css | 2 +- NzbDrone.Web/Controllers/AddSeriesController.cs | 9 +++++++-- NzbDrone.Web/Controllers/SettingsController.cs | 8 -------- NzbDrone.Web/Models/TvDbSearchResultModel.cs | 7 ++----- NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js | 2 +- NzbDrone.Web/Views/AddSeries/Index.cshtml | 9 +++------ 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/NzbDrone.Web/Content/NzbDrone.css b/NzbDrone.Web/Content/NzbDrone.css index 66daa000b..ec679a113 100644 --- a/NzbDrone.Web/Content/NzbDrone.css +++ b/NzbDrone.Web/Content/NzbDrone.css @@ -119,7 +119,7 @@ hr background: url(images/logo.png) no-repeat left top; background-color: #065EFE; font-size: 110px; - color: rgb(249, 249, 249); + color: white; /**color: rgb(40, 40, 40);**/ text-transform: lowercase; letter-spacing: -1px; diff --git a/NzbDrone.Web/Controllers/AddSeriesController.cs b/NzbDrone.Web/Controllers/AddSeriesController.cs index 8a38d5f49..8ef98a32b 100644 --- a/NzbDrone.Web/Controllers/AddSeriesController.cs +++ b/NzbDrone.Web/Controllers/AddSeriesController.cs @@ -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); diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index e47af1db1..cfcc9f8cb 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -49,14 +49,6 @@ namespace NzbDrone.Web.Controllers _seriesProvider = seriesProvider; } - public JsonResult TestResults(string q) - { - var results = new List(); - 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() { diff --git a/NzbDrone.Web/Models/TvDbSearchResultModel.cs b/NzbDrone.Web/Models/TvDbSearchResultModel.cs index d411ceebd..de0279419 100644 --- a/NzbDrone.Web/Models/TvDbSearchResultModel.cs +++ b/NzbDrone.Web/Models/TvDbSearchResultModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; +using System.Linq; namespace NzbDrone.Web.Models { @@ -9,6 +6,6 @@ namespace NzbDrone.Web.Models { public int Id { get; set; } public string Title { get; set; } - public string FirstAired { get; set; } + public string Banner { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js b/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js index e10bddc3d..421f20937 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js +++ b/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js @@ -65,7 +65,7 @@ function bindSeriesAutoComplete(selector) { .data("autocomplete")._renderItem = function (ul, item) { return $("
  • ") .data("item.autocomplete", item) - .append("
    " + item.Title + "
    " + item.FirstAired + "
    ") + .append("
    " + item.Title + "
    ") .appendTo(ul); }; }); diff --git a/NzbDrone.Web/Views/AddSeries/Index.cshtml b/NzbDrone.Web/Views/AddSeries/Index.cshtml index 414b328d3..63bc3e28f 100644 --- a/NzbDrone.Web/Views/AddSeries/Index.cshtml +++ b/NzbDrone.Web/Views/AddSeries/Index.cshtml @@ -42,15 +42,12 @@ background-size: 18px 18px } - .ui-autocomplete .seriesLookupTitle { + .ui-autocomplete .seriesLookupTitle{ font-size: 110%; - font-family: "Segoe UI Light", "Open Sans", "Segoe UI", sans-serif; + font-family: "Segoe UI", "Open Sans", "Segoe UI", sans-serif; color: lightgrey; } - - .ui-autocomplete .seriesLookupFirstAired { - font-family: "Segoe UI Light", "Open Sans", "Segoe UI", sans-serif; - } + }