Removed double logging, bug fixes
This commit is contained in:
1 parent
684ef44f84
commit
2884488338
1 file changed
+4
-9
@@ -481,37 +481,32 @@ class Renamer(Plugin):
|
|||||||
db = get_session()
|
db = get_session()
|
||||||
rels = db.query(Relea).filter_by(status_id = snatched_status.get('id'))
|
rels = db.query(Relea).filter_by(status_id = snatched_status.get('id'))
|
||||||
|
|
||||||
log.debug('Checking snatched releases... %s', 'ops')
|
|
||||||
|
|
||||||
for rel in rels:
|
for rel in rels:
|
||||||
log.debug('Checking snatched release: %s' , rel.movie.library.titles[0].title)
|
log.debug('Checking snatched release: %s' , rel.movie.library.titles[0].title)
|
||||||
|
|
||||||
item = {}
|
item = {}
|
||||||
for info in rel.info:
|
for info in rel.info:
|
||||||
item[info.identifier] = info.value
|
item[info.identifier] = info.value
|
||||||
|
|
||||||
log.debug('Checking status snatched release: %s' , item.get('name'))
|
log.debug('Checking status snatched release: %s' , item.get('name'))
|
||||||
|
|
||||||
mymovie = rel.movie.to_dict({
|
mov = rel.movie.to_dict({
|
||||||
'profile': {'types': {'quality': {}}},
|
'profile': {'types': {'quality': {}}},
|
||||||
'releases': {'status': {}, 'quality': {}},
|
'releases': {'status': {}, 'quality': {}},
|
||||||
'library': {'titles': {}, 'files':{}},
|
'library': {'titles': {}, 'files':{}},
|
||||||
'files': {}
|
'files': {}
|
||||||
})
|
})
|
||||||
|
|
||||||
log.debug('Checking status snatched release: %s' , mymovie['library'].get('identifier'))
|
|
||||||
|
|
||||||
# check status
|
# check status
|
||||||
downloadfailed = fireEvent('getdownloadfailed', data = item, movie = mymovie)
|
downloadfailed = fireEvent('getdownloadfailed', data = item, movie = mov)
|
||||||
|
|
||||||
if downloadfailed:
|
if downloadfailed:
|
||||||
log.debug('Download of %s failed', item['name'])
|
|
||||||
|
|
||||||
# if failed set status to ignored
|
# if failed set status to ignored
|
||||||
rel.status_id = ignored_status.get('id')
|
rel.status_id = ignored_status.get('id')
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
# search/download again
|
# search/download again
|
||||||
log.info('Download of %s failed, trying next release...', item['name'])
|
log.info('Download of %s failed, trying next release...', item['name'])
|
||||||
fireEvent('searcher.single', rel.movie)
|
fireEvent('searcher.single', mov)
|
||||||
|
|
||||||
return
|
return
|
||||||
Reference in new issue
Block a user