mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 14:55:20 -07:00
Refresh IsDuplicate in bulk import when the tmdbId changes (#1570)
This commit is contained in:
parent
e43e7d2b8d
commit
6767f602fb
1 changed files with 8 additions and 3 deletions
|
@ -13,9 +13,7 @@ module.exports = SelectAllCell.extend({
|
||||||
initialize : function() {
|
initialize : function() {
|
||||||
this._originalInit.apply(this, arguments);
|
this._originalInit.apply(this, arguments);
|
||||||
|
|
||||||
var tmdbId = this.model.get('tmdbId');
|
this._refreshIsDuplicate();
|
||||||
var existingMovie = FullMovieCollection.where({ tmdbId: tmdbId });
|
|
||||||
this.isDuplicate = existingMovie.length > 0 ? true : false;
|
|
||||||
|
|
||||||
this.listenTo(this.model, 'change', this._refresh);
|
this.listenTo(this.model, 'change', this._refresh);
|
||||||
},
|
},
|
||||||
|
@ -39,6 +37,13 @@ module.exports = SelectAllCell.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_refresh: function() {
|
_refresh: function() {
|
||||||
|
this._refreshIsDuplicate();
|
||||||
this.render();
|
this.render();
|
||||||
|
},
|
||||||
|
|
||||||
|
_refreshIsDuplicate: function() {
|
||||||
|
var tmdbId = this.model.get('tmdbId');
|
||||||
|
var existingMovie = FullMovieCollection.where({ tmdbId: tmdbId });
|
||||||
|
this.isDuplicate = existingMovie.length > 0 ? true : false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue