From b352abe9ba1375cf946a13e5592088a1e2493b81 Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Sat, 25 Feb 2017 08:59:17 -0800 Subject: [PATCH] Fix a bug in quality.single that led to exceptions When the DB was unable to find a quality for the identifier, a RecordNotFound exception was raised, leading to an exception in the event caller because the quality_dict was not returned. This now sets the quality to None and hands off to the event caller. --- couchpotato/core/plugins/quality/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/quality/main.py b/couchpotato/core/plugins/quality/main.py index f2cd100..a55eb06 100644 --- a/couchpotato/core/plugins/quality/main.py +++ b/couchpotato/core/plugins/quality/main.py @@ -114,7 +114,12 @@ class QualityPlugin(Plugin): db = get_db() quality_dict = {} - quality = db.get('quality', identifier, with_doc = True)['doc'] + try: + quality = db.get('quality', identifier, with_doc = True)['doc'] + except RecordNotFound: + log.error("Unable to find '%s' in the quality DB", indentifier) + quality = None + if quality: quality_dict = mergeDicts(self.getQuality(quality['identifier']), quality)