From 18a20ff1630220f4fcd71727d165b8a1ad7da638 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 28 May 2011 23:58:24 -0700 Subject: [PATCH] Some performance tweaks to speed up episode list view. --- NzbDrone.Core/Repository/Episode.cs | 8 ++++--- NzbDrone.Web/Controllers/SeriesController.cs | 11 +--------- NzbDrone.Web/NzbDrone.Web.csproj | 3 --- NzbDrone.Web/Views/Series/Details.cshtml | 22 +++++--------------- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/NzbDrone.Core/Repository/Episode.cs b/NzbDrone.Core/Repository/Episode.cs index 06a04f2b4..a7b6bd0cd 100644 --- a/NzbDrone.Core/Repository/Episode.cs +++ b/NzbDrone.Core/Repository/Episode.cs @@ -49,15 +49,17 @@ namespace NzbDrone.Core.Repository { get { - if (Ignored || (Season != null && !Season.Monitored)) return EpisodeStatusType.Ignored; + if (EpisodeFileId != 0) return EpisodeStatusType.Ready; + + var season = Season; + + if (Ignored || (season != null && !season.Monitored)) return EpisodeStatusType.Ignored; if (GrabDate != null && GrabDate.Value.AddDays(1) >= DateTime.Now) { return EpisodeStatusType.Downloading; } - if (EpisodeFileId != 0) return EpisodeStatusType.Ready; - if (AirDate.Date.Year > 1900 && DateTime.Now.Date >= AirDate.Date) { return EpisodeStatusType.Missing; diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index b2a21a837..0d78d8f00 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -55,15 +55,6 @@ namespace NzbDrone.Web.Controllers return RedirectToAction("Index"); } - public ActionResult LoadEpisodes(int seriesId) - { - _episodeProvider.RefreshEpisodeInfo(seriesId); - return RedirectToAction("Details", new - { - seriesId - }); - } - public ActionResult SeasonEditor(int seriesId) { var model = @@ -149,7 +140,7 @@ namespace NzbDrone.Web.Controllers return String.Empty; //Return the path relative to the Series' Folder - return file.Path.Replace(file.Series.Path, "").Trim(Path.DirectorySeparatorChar); + return file.Path; } public ActionResult SearchForSeries(string seriesName) diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index b5034d831..6599bccbe 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -871,9 +871,6 @@ - - -