From 000b7bf9e013d8c020e45ccc55f202a98d622fee Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 21 Apr 2013 18:21:24 -0700 Subject: [PATCH] Resync'd UI and API --- NzbDrone.Api/Series/SeriesModule.cs | 2 +- NzbDrone.Api/Series/SeriesResource.cs | 2 +- NzbDrone.Core/SeriesStats/SeriesStatistics.cs | 2 +- .../SeriesStats/SeriesStatisticsRepository.cs | 2 +- UI/Series/Index/SeriesGridItemTemplate.html | 8 ++++---- UI/Series/SeriesModel.js | 12 ++++++++++-- UI/app.js | 2 +- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/NzbDrone.Api/Series/SeriesModule.cs b/NzbDrone.Api/Series/SeriesModule.cs index 4dee24aef..9bb148601 100644 --- a/NzbDrone.Api/Series/SeriesModule.cs +++ b/NzbDrone.Api/Series/SeriesModule.cs @@ -52,7 +52,7 @@ namespace NzbDrone.Api.Series s.EpisodeCount = stats.EpisodeCount; s.EpisodeFileCount = stats.EpisodeFileCount; - s.SeasonsCount = stats.NumberOfSeasons; + s.SeasonCount = stats.SeasonCount; s.NextAiring = stats.NextAiring; } diff --git a/NzbDrone.Api/Series/SeriesResource.cs b/NzbDrone.Api/Series/SeriesResource.cs index 3c681b18f..e6361d493 100644 --- a/NzbDrone.Api/Series/SeriesResource.cs +++ b/NzbDrone.Api/Series/SeriesResource.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Api.Series //View Only public String Title { get; set; } - public Int32 SeasonsCount { get; set; } + public Int32 SeasonCount { get; set; } public Int32 EpisodeCount { get; set; } public Int32 EpisodeFileCount { get; set; } public SeriesStatusType Status { get; set; } diff --git a/NzbDrone.Core/SeriesStats/SeriesStatistics.cs b/NzbDrone.Core/SeriesStats/SeriesStatistics.cs index a873f500e..24893eb26 100644 --- a/NzbDrone.Core/SeriesStats/SeriesStatistics.cs +++ b/NzbDrone.Core/SeriesStats/SeriesStatistics.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Core.SeriesStats public class SeriesStatistics : ResultSet { public int SeriesId { get; set; } - public int NumberOfSeasons { get; set; } + public int SeasonCount { get; set; } public string NextAiringString { get; set; } public int EpisodeFileCount { get; set; } public int EpisodeCount { get; set; } diff --git a/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs b/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs index 2c2490f21..510bceeb2 100644 --- a/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs +++ b/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs @@ -27,7 +27,7 @@ namespace NzbDrone.Core.SeriesStats SeriesId, SUM(CASE WHEN Ignored = 0 AND Airdate <= @currentDate THEN 1 ELSE 0 END) AS EpisodeCount, SUM(CASE WHEN Ignored = 0 AND Episodes.EpisodeFileId > 0 AND AirDate <= @currentDate THEN 1 ELSE 0 END) as EpisodeFileCount, - MAX(Episodes.SeasonNumber) as NumberOfSeasons, + MAX(Episodes.SeasonNumber) as SeasonCount, MIN(CASE WHEN AirDate < @currentDate THEN NULL ELSE AirDate END) as NextAiringString FROM Episodes GROUP BY SeriesId"; diff --git a/UI/Series/Index/SeriesGridItemTemplate.html b/UI/Series/Index/SeriesGridItemTemplate.html index 7cd365f75..8285ee20e 100644 --- a/UI/Series/Index/SeriesGridItemTemplate.html +++ b/UI/Series/Index/SeriesGridItemTemplate.html @@ -29,12 +29,12 @@ {{#if bestDateString}} {{bestDateString}} {{else}} - {{status}} + {{statusText}} {{/if}} - Season {{numberOfSeasons}} + Season {{seasonCount}} {{else}} - {{status}} - {{numberOfSeasons}} Seasons + {{statusText}} + {{seasonCount}} Seasons {{/if}}
diff --git a/UI/Series/SeriesModel.js b/UI/Series/SeriesModel.js index 4c79e1e1a..fa5648c5f 100644 --- a/UI/Series/SeriesModel.js +++ b/UI/Series/SeriesModel.js @@ -35,11 +35,18 @@ return "http://trakt.tv/show/" + this.get('titleSlug'); }, isContinuing : function () { - if (this.get('status') === 'Continuing'){ + if (this.get('status') === 0){ return true; } return false; + }, + statusText: function () { + if (this.get('status') === 0) { + return 'Continuing'; + } + + return 'Ended'; } }, @@ -48,7 +55,8 @@ episodeCount : 0, qualityProfiles : qualityProfileCollection, rootFolders : rootFolders, - isExisting : false + isExisting : false, + status: 0 } }); diff --git a/UI/app.js b/UI/app.js index ff7c250aa..570c06f97 100644 --- a/UI/app.js +++ b/UI/app.js @@ -76,7 +76,7 @@ define('app', function () { if (!monitored) { return ''; } - if (status === 'Continuing') { + if (status === 0) { return ''; }