diff --git a/couchpotato/core/media/movie/_base/static/list.js b/couchpotato/core/media/movie/_base/static/list.js index aaa8be1..b8e96af 100644 --- a/couchpotato/core/media/movie/_base/static/list.js +++ b/couchpotato/core/media/movie/_base/static/list.js @@ -65,6 +65,7 @@ var MovieList = new Class({ movie.destroy(); delete self.movies_added[notification.data.id]; self.setCounter(self.counter_count-1); + self.total_movies--; } }) } @@ -75,6 +76,7 @@ var MovieList = new Class({ movieAdded: function(notification){ var self = this; + self.fireEvent('movieAdded', notification); if(self.options.add_new && !self.movies_added[notification.data.id] && notification.data.status.identifier == self.options.status){ window.scroll(0,0); self.createMovie(notification.data, 'top'); @@ -390,6 +392,7 @@ var MovieList = new Class({ self.movies.erase(movie); movie.destroy(); self.setCounter(self.counter_count-1); + self.total_movies--; }); self.calculateSelected(); diff --git a/couchpotato/static/scripts/page/home.js b/couchpotato/static/scripts/page/home.js index 9967ff4..099a988 100644 --- a/couchpotato/static/scripts/page/home.js +++ b/couchpotato/static/scripts/page/home.js @@ -57,6 +57,17 @@ Page.Home = new Class({ 'limit': null, 'onLoaded': function(){ self.chain.callChain(); + }, + 'onMovieAdded': function(notification){ + + // Track movie added + var after_search = function(data){ + // Force update after search + self.available_list.update(); + App.removeEvent('movie.searcher.ended.' + notification.data.id, after_search); + } + App.addEvent('movie.searcher.ended.' + notification.data.id, after_search); + } });