From 79a0f09b437ad11814da50809f798a91cdb8353e Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 30 Mar 2011 19:56:00 -0700 Subject: [PATCH 1/2] Added quality to Series detail view --- NzbDrone.Web/Controllers/SeriesController.cs | 15 +++++++++------ NzbDrone.Web/Models/EpisodeModel.cs | 3 +++ NzbDrone.Web/Views/Series/Details.aspx | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index f618af061..91a79b93f 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -9,6 +9,7 @@ using System.Web.Mvc; using NzbDrone.Core.Model; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; +using NzbDrone.Core.Repository.Quality; using NzbDrone.Web.Models; using Telerik.Web.Mvc; using TvdbLib.Data; @@ -138,7 +139,9 @@ namespace NzbDrone.Web.Controllers Title = c.Title, Overview = c.Overview, AirDate = c.AirDate, - Path = GetEpisodePath(c.EpisodeFile) + Path = GetEpisodePath(c.EpisodeFile), + Quality = c.EpisodeFile == null ? String.Empty : c.EpisodeFile.Quality.ToString() + }); return View(new GridModel(episodes)); } @@ -168,8 +171,8 @@ namespace NzbDrone.Web.Controllers //We still want to show this series as unmapped, but we don't know what it will be when mapped //Todo: Provide the user with a way to manually map a folder to a TvDb series (or make them rename the folder...) if (tvDbSeries == null) - tvDbSeries = new TvdbSeries {Id = 0, SeriesName = String.Empty}; - + tvDbSeries = new TvdbSeries { Id = 0, SeriesName = String.Empty }; + unmappedList.Add(new AddExistingSeriesModel { IsWanted = true, @@ -199,10 +202,10 @@ namespace NzbDrone.Web.Controllers //If the TvDbId for this show is 0 then skip it... User made a mistake... They will have to manually map it if (tvDbId < 1) continue; - unmappedList.Add(new SeriesMappingModel{Path = path, TvDbId = tvDbId, QualityProfileId = qualityProfileId}); + unmappedList.Add(new SeriesMappingModel { Path = path, TvDbId = tvDbId, QualityProfileId = qualityProfileId }); } - if(_syncProvider.BeginSyncUnmappedFolders(unmappedList)) + if (_syncProvider.BeginSyncUnmappedFolders(unmappedList)) return Content("Sync Started for Selected Series"); return Content("Sync already in progress, please wait for it to complete before retrying."); @@ -216,7 +219,7 @@ namespace NzbDrone.Web.Controllers if (_syncProvider.BeginAddNewSeries(dir, seriesId, seriesName, qualityProfileId)) return Content("Adding new series has started."); - + return Content("Unable to add new series, please wait for previous scans to complete first."); } diff --git a/NzbDrone.Web/Models/EpisodeModel.cs b/NzbDrone.Web/Models/EpisodeModel.cs index d31ae9a7c..b1644ae2a 100644 --- a/NzbDrone.Web/Models/EpisodeModel.cs +++ b/NzbDrone.Web/Models/EpisodeModel.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Web; +using NzbDrone.Core.Repository.Quality; namespace NzbDrone.Web.Models { @@ -14,5 +15,7 @@ namespace NzbDrone.Web.Models public string Overview { get; set; } public string Path { get; set; } public DateTime AirDate { get; set; } + + public String Quality { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Web/Views/Series/Details.aspx b/NzbDrone.Web/Views/Series/Details.aspx index 87c00a77e..384b36713 100644 --- a/NzbDrone.Web/Views/Series/Details.aspx +++ b/NzbDrone.Web/Views/Series/Details.aspx @@ -66,13 +66,14 @@ .Width(1) .HtmlAttributes(new { style = "text-align:center" }); - columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode"); + columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode"); columns.Bound(c => c.Title).Title("Title"); columns.Bound(c => c.AirDate).Format("{0:d}").Width(0); + columns.Bound(c => c.Quality); columns.Bound(c => c.Path); }) //.DetailView(detailView => detailView.Template(e => Html.RenderPartial("EpisodeDetail", e))) - .DetailView(detailView => detailView.ClientTemplate("
<#= Overview #>
")) + .DetailView(detailView => detailView.ClientTemplate("
<#= Overview #>
<#= Path #>
")) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true)) .Footer(false) .DataBinding(d => d.Ajax().Select("_AjaxSeasonGrid", "Series", new RouteValueDictionary { { "seasonId", season1.SeasonId.ToString() } })) From f7a5e0d8f83d2cd1c7c6c457113ee714305f5b0e Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 30 Mar 2011 21:04:15 -0700 Subject: [PATCH 2/2] removed github fork button removed duplicated scan disk menu --- NzbDrone.Web/Controllers/SeriesController.cs | 9 --------- NzbDrone.Web/Views/Series/Details.aspx | 1 - NzbDrone.Web/Views/Shared/Site.Master | 14 +++++--------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 91a79b93f..c98228cc5 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -390,15 +390,6 @@ namespace NzbDrone.Web.Controllers return RedirectToAction("Index"); } - public ActionResult ReScanFiles(int seriesId) - { - var epFiles = _mediaFileProvider.GetEpisodeFiles().Where(s => s.SeriesId == seriesId).ToList(); - _mediaFileProvider.CleanUp(epFiles); - _mediaFileProvider.Scan(_seriesProvider.GetSeries(seriesId)); - - return RedirectToAction("Details", "Series", new { seriesId }); - } - //Local Helpers private string GetEpisodePath(EpisodeFile file) { diff --git a/NzbDrone.Web/Views/Series/Details.aspx b/NzbDrone.Web/Views/Series/Details.aspx index 384b36713..7c96fe1da 100644 --- a/NzbDrone.Web/Views/Series/Details.aspx +++ b/NzbDrone.Web/Views/Series/Details.aspx @@ -14,7 +14,6 @@ items.Add().Text("Back to Series List").Action("Index", "Series"); items.Add().Text("Scan For Episodes on Disk").Action("SyncEpisodesOnDisk", "Series", new { seriesId = Model.SeriesId }); items.Add().Text("Rename Series").Action("RenameSeries", "Series", new { seriesId = Model.SeriesId }); - items.Add().Text("Re-Scan Files").Action("ReScanFiles", "Series", new { seriesId = Model.SeriesId }); }).Render(); %> diff --git a/NzbDrone.Web/Views/Shared/Site.Master b/NzbDrone.Web/Views/Shared/Site.Master index 473cbcd95..a5036b374 100644 --- a/NzbDrone.Web/Views/Shared/Site.Master +++ b/NzbDrone.Web/Views/Shared/Site.Master @@ -13,20 +13,16 @@ .Add("notibar.css")) .Render(); %> - - - + + <%----%> - + + - - ForkMe - -
- + <% Html.Telerik().ScriptRegistrar().Scripts( c => c.Add("jquery-ui-1.8.8.min.js") .Add("jquery.form.js")