Don't download automatically but enable provider. #135
This commit is contained in:
1 parent
796bb3987d
commit
7b716f3b9d
11 files changed
+45
-11
No files matched your search
@@ -40,3 +40,9 @@ class Downloader(Plugin):
|
|||||||
log.debug("Downloader doesn't support this type")
|
log.debug("Downloader doesn't support this type")
|
||||||
|
|
||||||
return is_correct
|
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',
|
'type': 'dropdown',
|
||||||
'values': [('nzbs & torrents', 'both'), ('nzb', 'nzb'), ('torrent', 'torrent')],
|
'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']
|
type = ['nzb', 'torrent']
|
||||||
|
|
||||||
def download(self, data = {}, movie = {}):
|
def download(self, data = {}, movie = {}, manual = False):
|
||||||
if self.isDisabled() or (not self.isCorrectType(data.get('type')) or (not self.conf('use_for') in ['both', data.get('type')])):
|
if self.isDisabled(manual) or (not self.isCorrectType(data.get('type')) or (not self.conf('use_for') in ['both', data.get('type')])):
|
||||||
return
|
return
|
||||||
|
|
||||||
directory = self.conf('directory')
|
directory = self.conf('directory')
|
||||||
|
|||||||
@@ -33,6 +33,13 @@ config = [{
|
|||||||
'default': 'Movies',
|
'default': 'Movies',
|
||||||
'description': 'The category CP places the nzb in. Like <strong>movies</strong> or <strong>couchpotato</strong>',
|
'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.',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ class NZBGet(Downloader):
|
|||||||
|
|
||||||
url = 'http://nzbget:%(password)s@%(host)s/xmlrpc'
|
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
|
return
|
||||||
|
|
||||||
log.info('Sending "%s" to NZBGet.' % data.get('name'))
|
log.info('Sending "%s" to NZBGet.' % data.get('name'))
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ config = [{
|
|||||||
'type': 'directory',
|
'type': 'directory',
|
||||||
'description': 'Your Post-Processing Script directory, set in Sabnzbd > Config > Directories.',
|
'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.',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ class Sabnzbd(Downloader):
|
|||||||
|
|
||||||
type = ['nzb']
|
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
|
return
|
||||||
|
|
||||||
log.info("Sending '%s' to SABnzbd." % data.get('name'))
|
log.info("Sending '%s' to SABnzbd." % data.get('name'))
|
||||||
|
|||||||
@@ -48,6 +48,13 @@ config = [{
|
|||||||
'advanced': True,
|
'advanced': True,
|
||||||
'description': 'Stop transfer when reaching ratio',
|
'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']
|
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
|
return
|
||||||
|
|
||||||
log.info('Sending "%s" to Transmission.' % data.get('name'))
|
log.info('Sending "%s" to Transmission.' % data.get('name'))
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class Release(Plugin):
|
|||||||
'releases': {'status': {}, 'quality': {}},
|
'releases': {'status': {}, 'quality': {}},
|
||||||
'library': {'titles': {}, 'files':{}},
|
'library': {'titles': {}, 'files':{}},
|
||||||
'files': {}
|
'files': {}
|
||||||
}))
|
}), manual = True)
|
||||||
|
|
||||||
return jsonified({
|
return jsonified({
|
||||||
'success': True
|
'success': True
|
||||||
|
|||||||
@@ -135,10 +135,10 @@ class Searcher(Plugin):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def download(self, data, movie):
|
def download(self, data, movie, manual = False):
|
||||||
|
|
||||||
snatched_status = fireEvent('status.get', 'snatched', single = True)
|
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:
|
if successful:
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user