Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Manually get media with status
Browse files Browse the repository at this point in the history
  • Loading branch information
RuudBurger committed Jun 23, 2014
1 parent d227105 commit 4008cce
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions couchpotato/core/media/_base/media/main.py
Expand Up @@ -167,8 +167,15 @@ def withStatus(self, status, with_doc = True):
status = list(status if isinstance(status, (list, tuple)) else [status])

for s in status:
for ms in db.get_many('media_status', s, with_doc = with_doc):
yield ms['doc'] if with_doc else ms
for ms in db.get_many('media_status', s):
if with_doc:
try:
doc = db.get('id', ms['_id'])
yield doc
except RecordNotFound:
log.debug('Record not found, skipping: %s', ms['_id'])
else:
yield ms

def withIdentifiers(self, identifiers, with_doc = False):

Expand Down

0 comments on commit 4008cce

Please sign in to comment.