From 6a3d886588e1c8fd4a345ca4750affbc41aeacca Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 2 May 2013 17:25:51 -0700 Subject: [PATCH] Missing doesn't double fetch --- NzbDrone.Core/Datastore/TableMapping.cs | 5 ++++- NzbDrone.Core/Tv/EpisodeRepository.cs | Bin 9468 -> 5818 bytes UI/Index.html | 2 +- UI/JsLibraries/backbone.backgrid.filter.js | 2 +- UI/Missing/MissingLayout.js | 1 - UI/Mixins/backbone.Backgrid.mixin.js | 9 --------- UI/Series/SeriesCollection.js | 11 ++++++----- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/NzbDrone.Core/Datastore/TableMapping.cs b/NzbDrone.Core/Datastore/TableMapping.cs index 018ee4198..8762074ea 100644 --- a/NzbDrone.Core/Datastore/TableMapping.cs +++ b/NzbDrone.Core/Datastore/TableMapping.cs @@ -49,7 +49,10 @@ namespace NzbDrone.Core.Datastore .HasOne(s => s.QualityProfile, s => s.QualityProfileId); Mapper.Entity().RegisterModel("Seasons"); - Mapper.Entity().RegisterModel("Episodes"); + + Mapper.Entity().RegisterModel("Episodes") + .Ignore(e => e.SeriesTitle); + Mapper.Entity().RegisterModel("EpisodeFiles"); Mapper.Entity().RegisterModel("QualityProfiles"); diff --git a/NzbDrone.Core/Tv/EpisodeRepository.cs b/NzbDrone.Core/Tv/EpisodeRepository.cs index 181bbd10552246b42e2194b37a05807adabbe0c6..e50f199d9fe4da0f150de4b9145798d458f24d41 100644 GIT binary patch delta 191 zcmez4xl5P%{qFr6%y^j-pKmtlS$SOCl;62623>2Tt$fvn^9zQQ*cwlL2QKg=9eraBb2GArsg;YJ) zg3RLllvKCOoK(*g1zTGM0|hlTpm=ahAjbk2aktWLjz!NS-*xoYF(u61a zERA@)ygFiPQG1@Bnm>EBrhnG#?hMfQkmVI-JOKZ zxyo3`p~+)*x4ZMOy94;k@~c>cAQH{xHSG+>nNVoZCC^eNP|yMnAUI}9g!R-ryJ=vU zSYE`>F2Dz_J!A?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_f7^+3)&Kwi diff --git a/UI/Index.html b/UI/Index.html index 76ac7c253..c5ed1b2cf 100644 --- a/UI/Index.html +++ b/UI/Index.html @@ -119,7 +119,7 @@ - + diff --git a/UI/JsLibraries/backbone.backgrid.filter.js b/UI/JsLibraries/backbone.backgrid.filter.js index c98c6658b..bc869bc57 100644 --- a/UI/JsLibraries/backbone.backgrid.filter.js +++ b/UI/JsLibraries/backbone.backgrid.filter.js @@ -354,4 +354,4 @@ }); -}(jQuery, _, Backbone, Backgrid, lunr)); +}(jQuery, _, Backbone, Backgrid)); diff --git a/UI/Missing/MissingLayout.js b/UI/Missing/MissingLayout.js index eff80f94a..dd5ff3d2c 100644 --- a/UI/Missing/MissingLayout.js +++ b/UI/Missing/MissingLayout.js @@ -77,7 +77,6 @@ define([ initialize: function () { this.missingCollection = new NzbDrone.Missing.Collection(); - this.missingCollection.fetch(); }, onShow: function () { diff --git a/UI/Mixins/backbone.Backgrid.mixin.js b/UI/Mixins/backbone.Backgrid.mixin.js index 25343ea83..85eb1460e 100644 --- a/UI/Mixins/backbone.Backgrid.mixin.js +++ b/UI/Mixins/backbone.Backgrid.mixin.js @@ -30,15 +30,6 @@ Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({ var sortKey = this.collection.state.sortKey; var sortDir = this._convertIntToDirection(this.collection.state.order); - if (sortKey === this.column.get('name')) { - this.$el.children('i').addClass(this._convertDirectionToIcon(sortDir)); - this._direction = sortDir; - } - } - else if (this.collection.defaultSortKey) { - var sortKey = this.collection.defaultSortKey; - var sortDir = this._convertIntToDirection(this.collection.defaultSortDir); - if (sortKey === this.column.get('name')) { this.$el.children('i').addClass(this._convertDirectionToIcon(sortDir)); this._direction = sortDir; diff --git a/UI/Series/SeriesCollection.js b/UI/Series/SeriesCollection.js index 89e3528e0..2d9c58723 100644 --- a/UI/Series/SeriesCollection.js +++ b/UI/Series/SeriesCollection.js @@ -1,14 +1,15 @@ "use strict"; define(['app', 'Series/SeriesModel'], function () { - NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({ + NzbDrone.Series.SeriesCollection = Backbone.PageableCollection.extend({ url : NzbDrone.Constants.ApiRoot + '/series', model: NzbDrone.Series.SeriesModel, - defaultSortKey: 'title', - defaultSortDir: '-1', + mode: 'client', - comparator: function (model) { - return model.get(this.defaultSortKey); + state: { + sortKey: "title", + order: -1, + pageSize: 1000000 } }); });