NZBVortex: Delete failed option

This commit is contained in:
Ruud committed 2013-01-02 14:11:40 +01:00
1 parent d314a9b5b3
commit a1d4bab793
2 files changed
+21

No files matched your search

@@ -34,6 +34,12 @@ config = [{
'advanced': True, 'advanced': True,
'description': 'Disable this downloader for automated searches, but use it when I manually send a release.', '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.',
},
], ],
} }
], ],
@@ -64,6 +64,21 @@ class NZBVortex(Downloader):
return statuses 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): def login(self):
nonce = self.call('auth/nonce', auth = False).get('authNonce') nonce = self.call('auth/nonce', auth = False).get('authNonce')