From 2884488338d5bd98a98b431c80eb17eb509802de Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Sun, 29 Jul 2012 22:02:51 +0200 Subject: [PATCH] Removed double logging, bug fixes --- couchpotato/core/plugins/renamer/main.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index c8a76944..f0887acf 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -481,37 +481,32 @@ class Renamer(Plugin): db = get_session() rels = db.query(Relea).filter_by(status_id = snatched_status.get('id')) - log.debug('Checking snatched releases... %s', 'ops') - for rel in rels: log.debug('Checking snatched release: %s' , rel.movie.library.titles[0].title) + item = {} for info in rel.info: item[info.identifier] = info.value log.debug('Checking status snatched release: %s' , item.get('name')) - mymovie = rel.movie.to_dict({ + mov = rel.movie.to_dict({ 'profile': {'types': {'quality': {}}}, 'releases': {'status': {}, 'quality': {}}, 'library': {'titles': {}, 'files':{}}, 'files': {} }) - log.debug('Checking status snatched release: %s' , mymovie['library'].get('identifier')) - # check status - downloadfailed = fireEvent('getdownloadfailed', data = item, movie = mymovie) + downloadfailed = fireEvent('getdownloadfailed', data = item, movie = mov) if downloadfailed: - log.debug('Download of %s failed', item['name']) - # if failed set status to ignored rel.status_id = ignored_status.get('id') db.commit() # search/download again log.info('Download of %s failed, trying next release...', item['name']) - fireEvent('searcher.single', rel.movie) + fireEvent('searcher.single', mov) return