diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index 030e5459..d0f44202 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -16,6 +16,8 @@ log = CPLog(__name__) class Searcher(Plugin): + in_progress = False + def __init__(self): addEvent('searcher.all', self.all_movies) addEvent('searcher.single', self.single) @@ -27,6 +29,12 @@ class Searcher(Plugin): def all_movies(self): + if self.in_progress: + log.info('Search already in progress') + return + + self.in_progress = True + db = get_session() movies = db.query(Movie).filter( @@ -52,6 +60,8 @@ class Searcher(Plugin): if self.shuttingDown(): break + self.in_progress = False + def single(self, movie): available_status = fireEvent('status.get', 'available', single = True)