Don't download automatically but enable provider. #135

This commit is contained in:
Ruud
2012-04-24 08:23:00 +02:00
parent 796bb3987d
commit 7b716f3b9d
11 changed files with 45 additions and 11 deletions
+6
View File
@@ -40,3 +40,9 @@ class Downloader(Plugin):
log.debug("Downloader doesn't support this type")
return is_correct
def isDisabled(self, manual):
return not self.isEnabled(manual)
def isEnabled(self, manual):
return super(Downloader, self).isEnabled(), ((self.conf('manual', default = False) and manual) or manual is True)
@@ -32,6 +32,13 @@ config = [{
'type': 'dropdown',
'values': [('nzbs & torrents', 'both'), ('nzb', 'nzb'), ('torrent', 'torrent')],
},
{
'name': 'manual',
'default': 0,
'type': 'bool',
'advanced': True,
'description': 'Disable this downloader for automated searches, but use it when I manually send a release.',
},
],
}
],
@@ -10,8 +10,8 @@ class Blackhole(Downloader):
type = ['nzb', 'torrent']
def download(self, data = {}, movie = {}):
if self.isDisabled() or (not self.isCorrectType(data.get('type')) or (not self.conf('use_for') in ['both', data.get('type')])):
def download(self, data = {}, movie = {}, manual = False):
if self.isDisabled(manual) or (not self.isCorrectType(data.get('type')) or (not self.conf('use_for') in ['both', data.get('type')])):
return
directory = self.conf('directory')
@@ -33,6 +33,13 @@ config = [{
'default': 'Movies',
'description': 'The category CP places the nzb in. Like <strong>movies</strong> or <strong>couchpotato</strong>',
},
{
'name': 'manual',
'default': 0,
'type': 'bool',
'advanced': True,
'description': 'Disable this downloader for automated searches, but use it when I manually send a release.',
},
],
}
],
+2 -2
View File
@@ -14,9 +14,9 @@ class NZBGet(Downloader):
url = 'http://nzbget:%(password)s@%(host)s/xmlrpc'
def download(self, data = {}, movie = {}):
def download(self, data = {}, movie = {}, manual = False):
if self.isDisabled() or not self.isCorrectType(data.get('type')):
if self.isDisabled(manual) or not self.isCorrectType(data.get('type')):
return
log.info('Sending "%s" to NZBGet.' % data.get('name'))
@@ -39,6 +39,13 @@ config = [{
'type': 'directory',
'description': 'Your Post-Processing Script directory, set in Sabnzbd > Config > Directories.',
},
{
'name': 'manual',
'default': 0,
'type': 'bool',
'advanced': True,
'description': 'Disable this downloader for automated searches, but use it when I manually send a release.',
},
],
}
],
+2 -2
View File
@@ -15,9 +15,9 @@ class Sabnzbd(Downloader):
type = ['nzb']
def download(self, data = {}, movie = {}):
def download(self, data = {}, movie = {}, manual = False):
if self.isDisabled() or not self.isCorrectType(data.get('type')):
if self.isDisabled(manual) or not self.isCorrectType(data.get('type')):
return
log.info("Sending '%s' to SABnzbd." % data.get('name'))
@@ -48,6 +48,13 @@ config = [{
'advanced': True,
'description': 'Stop transfer when reaching ratio',
},
{
'name': 'manual',
'default': 0,
'type': 'bool',
'advanced': True,
'description': 'Disable this downloader for automated searches, but use it when I manually send a release.',
},
],
}
],
@@ -11,9 +11,9 @@ class Transmission(Downloader):
type = ['torrent']
def download(self, data = {}, movie = {}):
def download(self, data = {}, movie = {}, manual = False):
if self.isDisabled() or not self.isCorrectType(data.get('type')):
if self.isDisabled(manual) or not self.isCorrectType(data.get('type')):
return
log.info('Sending "%s" to Transmission.' % data.get('name'))
+1 -1
View File
@@ -147,7 +147,7 @@ class Release(Plugin):
'releases': {'status': {}, 'quality': {}},
'library': {'titles': {}, 'files':{}},
'files': {}
}))
}), manual = True)
return jsonified({
'success': True
+2 -2
View File
@@ -135,10 +135,10 @@ class Searcher(Plugin):
return False
def download(self, data, movie):
def download(self, data, movie, manual = False):
snatched_status = fireEvent('status.get', 'snatched', single = True)
successful = fireEvent('download', data = data, movie = movie, single = True)
successful = fireEvent('download', data = data, movie = movie, manual = manual, single = True)
if successful: