Ignore current suggested results

This commit is contained in:
Ruud committed 2013-07-06 00:49:26 +02:00
1 parent 55af696b7c
commit 06a211a24a
1 file changed
+2 -3
+2 -3
View File
@@ -65,6 +65,7 @@ class Suggestion(Plugin):
# Combine with previous suggestion_cache # Combine with previous suggestion_cache
cached_suggestion = self.getCache('suggestion_cached') cached_suggestion = self.getCache('suggestion_cached')
new_suggestions = [] new_suggestions = []
ignored = [] if not ignored else ignored
if ignore_imdb: if ignore_imdb:
for cs in cached_suggestion: for cs in cached_suggestion:
@@ -79,9 +80,7 @@ class Suggestion(Plugin):
.filter(or_(*[Movie.status.has(identifier = s) for s in ['active', 'done']])).all() .filter(or_(*[Movie.status.has(identifier = s) for s in ['active', 'done']])).all()
movies = [x.library.identifier for x in active_movies] movies = [x.library.identifier for x in active_movies]
if ignored: ignored.extend([x.get('imdb') for x in cached_suggestion])
ignored.extend([x.get('imdb') for x in new_suggestions])
suggestions = fireEvent('movie.suggest', movies = movies, ignore = list(set(ignored)), single = True) suggestions = fireEvent('movie.suggest', movies = movies, ignore = list(set(ignored)), single = True)
if suggestions: if suggestions: