From c4badd72bd9003643070460cefa2f31214125b21 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 8 Jun 2013 15:23:17 -0700 Subject: [PATCH] added quality profile label --- Gruntfile.js | 1 + NzbDrone.Core/Tv/RefreshSeriesService.cs | 2 +- UI/Index.html | 2 +- UI/Quality/QualityProfilePartial.html | 1 + UI/Series/Details/SeriesDetailsTemplate.html | 1 + UI/Series/Index/List/CollectionView.js | 13 +++---------- UI/Series/Index/List/ItemTemplate.html | 4 ++-- UI/Series/Index/List/ItemView.js | 6 +----- UI/Series/Index/Posters/CollectionView.js | 13 +++---------- UI/Series/Index/Posters/ItemTemplate.html | 2 -- UI/Series/Index/Posters/ItemView.js | 4 ---- UI/Series/SeriesModel.js | 13 ++++++++----- 12 files changed, 22 insertions(+), 40 deletions(-) create mode 100644 UI/Quality/QualityProfilePartial.html diff --git a/Gruntfile.js b/Gruntfile.js index 40566b963..da73604c0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,6 +11,7 @@ module.exports = function (grunt) { 'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js', 'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js', 'UI/JsLibraries/backbone.relational.js' : 'http://raw.github.com/PaulUithol/Backbone-relational/0.8.5/backbone-relational.js', + 'UI/JsLibraries/backbone.associations.js' : 'http://raw.github.com/dhruvaray/backbone-associations/master/backbone-associations.js', 'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js', 'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js', diff --git a/NzbDrone.Core/Tv/RefreshSeriesService.cs b/NzbDrone.Core/Tv/RefreshSeriesService.cs index af6249595..e179f9712 100644 --- a/NzbDrone.Core/Tv/RefreshSeriesService.cs +++ b/NzbDrone.Core/Tv/RefreshSeriesService.cs @@ -160,7 +160,7 @@ namespace NzbDrone.Core.Tv allEpisodes.AddRange(newList); allEpisodes.AddRange(updateList); - var groups = allEpisodes.GroupBy(e => new { e.SeriesId, e.AirDate }).Where(g => g.Count() > 1).ToList(); + var groups = allEpisodes.Where(c=>c.AirDate.HasValue).GroupBy(e => new { e.SeriesId, e.AirDate }).Where(g => g.Count() > 1).ToList(); foreach (var group in groups) { diff --git a/UI/Index.html b/UI/Index.html index aaa017771..8b507f8b3 100644 --- a/UI/Index.html +++ b/UI/Index.html @@ -84,7 +84,7 @@ - + diff --git a/UI/Quality/QualityProfilePartial.html b/UI/Quality/QualityProfilePartial.html new file mode 100644 index 000000000..5f622ffad --- /dev/null +++ b/UI/Quality/QualityProfilePartial.html @@ -0,0 +1 @@ +{{name}} diff --git a/UI/Series/Details/SeriesDetailsTemplate.html b/UI/Series/Details/SeriesDetailsTemplate.html index 5fa0990cd..08079fdc8 100644 --- a/UI/Series/Details/SeriesDetailsTemplate.html +++ b/UI/Series/Details/SeriesDetailsTemplate.html @@ -7,6 +7,7 @@ {{overview}}
+ {{> QualityProfilePartial qualityProfile}} {{network}} {{runtime}} minutes {{path}} diff --git a/UI/Series/Index/List/CollectionView.js b/UI/Series/Index/List/CollectionView.js index 190e7ca56..364b18f8d 100644 --- a/UI/Series/Index/List/CollectionView.js +++ b/UI/Series/Index/List/CollectionView.js @@ -1,17 +1,10 @@ 'use strict'; -define(['app', 'Quality/QualityProfileCollection', 'Series/Index/List/ItemView', 'Config'], function (app, qualityProfileCollection) { +define(['app', 'Series/Index/List/ItemView', 'Config'], function () { NzbDrone.Series.Index.List.CollectionView = Backbone.Marionette.CompositeView.extend({ itemView : NzbDrone.Series.Index.List.ItemView, itemViewContainer : '#x-series-list', - template : 'Series/Index/List/CollectionTemplate', - qualityProfileCollection: qualityProfileCollection, - - initialize: function () { - this.qualityProfileCollection.fetch(); - - this.itemViewOptions = { qualityProfiles: this.qualityProfileCollection }; - } + template : 'Series/Index/List/CollectionTemplate' }); -}); \ No newline at end of file +}); diff --git a/UI/Series/Index/List/ItemTemplate.html b/UI/Series/Index/List/ItemTemplate.html index c3c109bc5..7c5c5c39a 100644 --- a/UI/Series/Index/List/ItemTemplate.html +++ b/UI/Series/Index/List/ItemTemplate.html @@ -32,14 +32,14 @@ {{#if isContinuing}} {{#if nextAiring}} {{date nextAiring}} - {{else}} - Continuing {{/if}} Season {{seasonCount}} {{else}} Ended {{seasonCount}} Seasons {{/if}} + + {{> QualityProfilePartial qualityProfile}}
diff --git a/UI/Series/Index/List/ItemView.js b/UI/Series/Index/List/ItemView.js index c3a3bd019..46eb1c4ea 100644 --- a/UI/Series/Index/List/ItemView.js +++ b/UI/Series/Index/List/ItemView.js @@ -18,11 +18,7 @@ define([ events: { 'click .x-edit' : 'editSeries', - 'click .x-remove': 'removeSeries', - }, - - initialize: function (options) { - this.qualityProfileCollection = options.qualityProfiles; + 'click .x-remove': 'removeSeries' }, editSeries: function () { diff --git a/UI/Series/Index/Posters/CollectionView.js b/UI/Series/Index/Posters/CollectionView.js index c652e1017..ebdfcfccc 100644 --- a/UI/Series/Index/Posters/CollectionView.js +++ b/UI/Series/Index/Posters/CollectionView.js @@ -1,17 +1,10 @@ 'use strict'; -define(['app', 'Quality/QualityProfileCollection', 'Series/Index/Posters/ItemView', 'Config'], function (app, qualityProfileCollection) { +define(['app', 'Series/Index/Posters/ItemView', 'Config'], function () { NzbDrone.Series.Index.Posters.CollectionView = Backbone.Marionette.CompositeView.extend({ itemView : NzbDrone.Series.Index.Posters.ItemView, itemViewContainer : '#x-series-posters', - template : 'Series/Index/Posters/CollectionTemplate', - qualityProfileCollection: qualityProfileCollection, - - initialize: function () { - this.qualityProfileCollection.fetch(); - - this.itemViewOptions = { qualityProfiles: this.qualityProfileCollection }; - } + template : 'Series/Index/Posters/CollectionTemplate' }); -}); \ No newline at end of file +}); diff --git a/UI/Series/Index/Posters/ItemTemplate.html b/UI/Series/Index/Posters/ItemTemplate.html index f95e41074..b7d30a454 100644 --- a/UI/Series/Index/Posters/ItemTemplate.html +++ b/UI/Series/Index/Posters/ItemTemplate.html @@ -23,8 +23,6 @@ {{#if isContinuing}} {{#if nextAiring}} {{date nextAiring}} - {{else}} - Continuing {{/if}} Season {{seasonCount}} {{else}} diff --git a/UI/Series/Index/Posters/ItemView.js b/UI/Series/Index/Posters/ItemView.js index f91b8a810..1d034d476 100644 --- a/UI/Series/Index/Posters/ItemView.js +++ b/UI/Series/Index/Posters/ItemView.js @@ -2,7 +2,6 @@ define([ 'app', - 'Quality/QualityProfileCollection', 'Series/SeriesCollection', 'Series/Edit/EditSeriesView', 'Series/Delete/DeleteSeriesView' @@ -26,9 +25,6 @@ define([ 'mouseleave .x-series-poster': 'posterHoverAction' }, - initialize: function (options) { - this.qualityProfileCollection = options.qualityProfiles; - }, editSeries: function () { var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model}); diff --git a/UI/Series/SeriesModel.js b/UI/Series/SeriesModel.js index 44b8249e1..e7c8b4807 100644 --- a/UI/Series/SeriesModel.js +++ b/UI/Series/SeriesModel.js @@ -1,5 +1,5 @@ "use strict"; -define(['app', 'Quality/QualityProfileCollection', 'AddSeries/RootFolders/RootFolderCollection'], function (app, qualityProfileCollection, rootFolders) { +define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) { NzbDrone.Series.SeriesModel = Backbone.Model.extend({ urlRoot: NzbDrone.Constants.ApiRoot + '/series', @@ -29,7 +29,7 @@ define(['app', 'Quality/QualityProfileCollection', 'AddSeries/RootFolders/RootFo traktUrl : function () { return "http://trakt.tv/show/" + this.get('titleSlug'); }, - imdbUrl : function () { + imdbUrl : function () { return "http://imdb.com/title/" + this.get('imdbId'); }, isContinuing : function () { @@ -44,16 +44,19 @@ define(['app', 'Quality/QualityProfileCollection', 'AddSeries/RootFolders/RootFo return Date.create(date).short(); }, - route : function(){ + route : function () { return '/series/details/' + this.get('titleSlug'); + //return '/series/details/' + this.get('id'); + }, + + qualityProfile: function () { + return qualityProfiles.get(this.get('qualityProfileId')).toJSON(); } }, defaults: { episodeFileCount: 0, episodeCount : 0, - qualityProfiles : qualityProfileCollection, - rootFolders : rootFolders, isExisting : false, status : 0 }