From 38ce63795c3d5afe265470b28fab167c68b891b4 Mon Sep 17 00:00:00 2001 From: Ruud Date: Thu, 3 Oct 2013 08:26:02 +0200 Subject: [PATCH] Check snatched with single query --- couchpotato/core/plugins/renamer/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index c2b71361..fe28a2d8 100755 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -661,9 +661,9 @@ Remove it if you want it to be renamed (again, or at least let it try again) fireEvent('status.get', ['snatched', 'ignored', 'failed', 'done', 'seeding', 'downloaded', 'missing'], single = True) db = get_session() - rels = db.query(Release).filter_by(status_id = snatched_status.get('id')).all() - rels.extend(db.query(Release).filter_by(status_id = seeding_status.get('id')).all()) - rels.extend(db.query(Release).filter_by(status_id = missing_status.get('id')).all()) + rels = db.query(Release).filter( + Release.status_id.in_(snatched_status.get('id'), seeding_status.get('id'), missing_status.get('id')) + ).all() scan_items = [] scan_required = False