NZBVortex: Delete failed option

This commit is contained in:
Ruud
2013-01-02 14:11:40 +01:00
parent d314a9b5b3
commit a1d4bab793
2 changed files with 21 additions and 0 deletions

View File

@@ -34,6 +34,12 @@ config = [{
'advanced': True,
'description': 'Disable this downloader for automated searches, but use it when I manually send a release.',
},
{
'name': 'delete_failed',
'default': True,
'type': 'bool',
'description': 'Delete a release after the download has failed.',
},
],
}
],

View File

@@ -64,6 +64,21 @@ class NZBVortex(Downloader):
return statuses
def removeFailed(self, item):
if not self.conf('delete_failed', default = True):
return False
log.info('%s failed downloading, deleting...', item['name'])
try:
self.call('nzb/%s/cancel' % item['id'])
except:
log.error('Failed deleting: %s', traceback.format_exc(0))
return False
return True
def login(self):
nonce = self.call('auth/nonce', auth = False).get('authNonce')