Check movie exists before adding releases

This commit is contained in:
Ruud
2012-05-11 15:31:25 +02:00
parent 30022fef8f
commit 369f08b00b
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ from couchpotato.core.settings.model import File
from couchpotato.environment import Env
from enzyme.exceptions import NoParserError, ParseError
from guessit import guess_movie_info
from subliminal.videos import scan, Video
from subliminal.videos import Video
import enzyme
import os
import re
@@ -101,6 +101,10 @@ class Searcher(Plugin):
if len(sorted_results) == 0:
log.debug('Nothing found for %s in %s' % (default_title, quality_type['quality']['label']))
# Check if movie isn't deleted while searching
if not db.query(Movie).filter_by(id = movie.get('id')).first():
return
# Add them to this movie releases list
for nzb in sorted_results: