From edb232df606db6e13b570659bb3bffe83cf0cc60 Mon Sep 17 00:00:00 2001 From: Ruud <ruud@crashdummy.nl> Date: Mon, 4 Feb 2013 22:35:25 +0100 Subject: [PATCH] Don't fire progress untill other request ended --- couchpotato/static/scripts/page/wanted.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/couchpotato/static/scripts/page/wanted.js b/couchpotato/static/scripts/page/wanted.js index 3f6e065b..a9e0bc71 100644 --- a/couchpotato/static/scripts/page/wanted.js +++ b/couchpotato/static/scripts/page/wanted.js @@ -52,7 +52,8 @@ Page.Wanted = new Class({ var start_text = self.manual_search.get('text'); self.progress_interval = setInterval(function(){ - Api.request('searcher.progress', { + if(self.search_progress && self.search_progress.running) return; + self.search_progress = Api.request('searcher.progress', { 'onComplete': function(json){ self.search_in_progress = true; if(!json.progress){ @@ -65,7 +66,7 @@ Page.Wanted = new Class({ self.manual_search.set('text', 'Searching.. (' + (((progress.total-progress.to_go)/progress.total)*100).round() + '%)'); } } - }) + }); }, 1000); } -- GitLab