Check if movie is done in checkSnatched. Fixes #760.

This commit is contained in:
mano3m
2012-08-28 17:19:14 +02:00
committed by Ruud
parent 10052b7e86
commit 7f159b6229
@@ -453,6 +453,8 @@ class Searcher(Plugin):
ignored_status = fireEvent('status.get', 'ignored', single = True)
failed_status = fireEvent('status.get', 'failed', single = True)
done_status = fireEvent('status.get', 'done', single = True)
db = get_session()
rels = db.query(Release).filter_by(status_id = snatched_status.get('id'))
@@ -470,6 +472,13 @@ class Searcher(Plugin):
log.debug('Checking snatched movie: %s' , default_title)
# Check if movie has already completed and is manage tab (legacy db correction)
if rel.movie.status_id == done_status.get('id'):
log.debug('Found a completed movie with a snatched release : %s. Setting release status to ignored...' , default_title)
rel.status_id = ignored_status.get('id')
db.commit()
continue
item = {}
for info in rel.info:
item[info.identifier] = info.value