Browse Source

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.
pull/7184/head
Chris Rose 8 years ago
parent
commit
b352abe9ba
No known key found for this signature in database GPG Key ID: 8AA3F3AA876C57A5
  1. 7
      couchpotato/core/plugins/quality/main.py

7
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)

Loading…
Cancel
Save