From 6767f602fb17bb7e537c5da1420fe87a68bcdb6e Mon Sep 17 00:00:00 2001 From: Sentir101 Date: Thu, 25 May 2017 15:44:43 +0200 Subject: [PATCH] Refresh IsDuplicate in bulk import when the tmdbId changes (#1570) --- .../AddMovies/BulkImport/BulkImportSelectAllCell.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/UI/AddMovies/BulkImport/BulkImportSelectAllCell.js b/src/UI/AddMovies/BulkImport/BulkImportSelectAllCell.js index 66a51ce8c..82563f701 100644 --- a/src/UI/AddMovies/BulkImport/BulkImportSelectAllCell.js +++ b/src/UI/AddMovies/BulkImport/BulkImportSelectAllCell.js @@ -13,9 +13,7 @@ module.exports = SelectAllCell.extend({ initialize : function() { this._originalInit.apply(this, arguments); - var tmdbId = this.model.get('tmdbId'); - var existingMovie = FullMovieCollection.where({ tmdbId: tmdbId }); - this.isDuplicate = existingMovie.length > 0 ? true : false; + this._refreshIsDuplicate(); this.listenTo(this.model, 'change', this._refresh); }, @@ -39,6 +37,13 @@ module.exports = SelectAllCell.extend({ }, _refresh: function() { + this._refreshIsDuplicate(); this.render(); + }, + + _refreshIsDuplicate: function() { + var tmdbId = this.model.get('tmdbId'); + var existingMovie = FullMovieCollection.where({ tmdbId: tmdbId }); + this.isDuplicate = existingMovie.length > 0 ? true : false; } });