Search is now fixed too.

pull/882/head
Leonardo Galli 8 years ago
parent 21fa96f78f
commit 15acb9d204

@ -2,7 +2,7 @@ var $ = require('jquery');
var _ = require('underscore');
var SelectAllCell = require('../../Cells/SelectAllCell');
var Backgrid = require('backgrid');
var MoviesCollection = require('../../Movies/MoviesCollection');
var FullMovieCollection = require('../../Movies/FullMovieCollection');
module.exports = SelectAllCell.extend({
_originalRender : SelectAllCell.prototype.render,
@ -13,7 +13,7 @@ module.exports = SelectAllCell.extend({
this._originalInit.apply(this, arguments);
var tmdbId = this.model.get('tmdbId');
var existingMovie = MoviesCollection.where({ tmdbId: tmdbId });
var existingMovie = FullMovieCollection.where({ tmdbId: tmdbId });
this.isDuplicate = existingMovie.length > 0 ? true : false;
this.listenTo(this.model, 'change', this._refresh);

@ -1,6 +1,6 @@
var Marionette = require('marionette');
var SearchResultView = require('./SearchResultView');
var MoviesCollection = require('../Movies/MoviesCollection');
var FullMovieCollection = require('../Movies/FullMovieCollection');
var vent = require('vent');
module.exports = Marionette.CollectionView.extend({
@ -48,7 +48,7 @@ module.exports = Marionette.CollectionView.extend({
appendHtml : function(collectionView, itemView, index) {
var tmdbId = itemView.model.get('tmdbId');
var existingMovies = MoviesCollection.where({ tmdbId: tmdbId });
var existingMovies = FullMovieCollection.where({ tmdbId: tmdbId });
if(existingMovies.length > 0) {
if(this.showExisting) {
if (index < this.showing || index === 0) {

@ -6,7 +6,7 @@ var Marionette = require('marionette');
var Profiles = require('../Profile/ProfileCollection');
var RootFolders = require('./RootFolders/RootFolderCollection');
var RootFolderLayout = require('./RootFolders/RootFolderLayout');
var MoviesCollection = require('../Movies/MoviesCollection');
var FullMovieCollection = require('../Movies/FullMovieCollection');
var Config = require('../Config');
var Messenger = require('../Shared/Messenger');
var AsValidatedView = require('../Mixins/AsValidatedView');
@ -106,7 +106,7 @@ var view = Marionette.ItemView.extend({
},
_configureTemplateHelpers : function() {
var existingMovies = MoviesCollection.where({ tmdbId : this.model.get('tmdbId') });
var existingMovies = FullMovieCollection.where({ tmdbId : this.model.get('tmdbId') });
if (existingMovies.length > 0) {
this.templateHelpers.existing = existingMovies[0].toJSON();
}
@ -217,7 +217,7 @@ var view = Marionette.ItemView.extend({
});
promise.done(function() {
MoviesCollection.add(self.model);
FullMovieCollection.add(self.model);
self.close();

Loading…
Cancel
Save