Browse Source

Use @mano3m code to check download_info

pull/1595/head
Ruud 12 years ago
parent
commit
72cc3576d3
  1. 21
      couchpotato/core/plugins/renamer/main.py

21
couchpotato/core/plugins/renamer/main.py

@ -118,13 +118,23 @@ class Renamer(Plugin):
# Get the release with the downloader ID that was downloded by the downloader
download_info = None
if download_id:
rls_info = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).first()
if download_id and downloader:
rls = None
if rls_info:
rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = downloader).all()
rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).all()
for rlsnfo_dwnld in rlsnfo_dwnlds:
for rlsnfo_id in rlsnfo_ids:
if rlsnfo_id.release == rlsnfo_dwnld.release:
rls = rlsnfo_id.release
break
if rls: break
if rls:
download_info = {
'imdb_id': rls_info.release.movie.library.identifier,
'quality': rls_info.release.quality.identifier,
'imdb_id': rls.movie.library.identifier,
'quality': rls.quality.identifier,
}
else:
log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader))
@ -582,6 +592,7 @@ class Renamer(Plugin):
loge('Couldn\'t remove empty directory %s: %s', (folder, traceback.format_exc()))
def checkSnatched(self):
if self.checking_snatched:
log.debug('Already checking snatched')

Loading…
Cancel
Save