Browse Source

Don't download automatically but enable provider. #135

pull/152/head
Ruud 13 years ago
parent
commit
7b716f3b9d
  1. 6
      couchpotato/core/downloaders/base.py
  2. 7
      couchpotato/core/downloaders/blackhole/__init__.py
  3. 4
      couchpotato/core/downloaders/blackhole/main.py
  4. 7
      couchpotato/core/downloaders/nzbget/__init__.py
  5. 4
      couchpotato/core/downloaders/nzbget/main.py
  6. 7
      couchpotato/core/downloaders/sabnzbd/__init__.py
  7. 4
      couchpotato/core/downloaders/sabnzbd/main.py
  8. 7
      couchpotato/core/downloaders/transmission/__init__.py
  9. 4
      couchpotato/core/downloaders/transmission/main.py
  10. 2
      couchpotato/core/plugins/release/main.py
  11. 4
      couchpotato/core/plugins/searcher/main.py

6
couchpotato/core/downloaders/base.py

@ -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)

7
couchpotato/core/downloaders/blackhole/__init__.py

@ -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.',
},
],
}
],

4
couchpotato/core/downloaders/blackhole/main.py

@ -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')

7
couchpotato/core/downloaders/nzbget/__init__.py

@ -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.',
},
],
}
],

4
couchpotato/core/downloaders/nzbget/main.py

@ -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'))

7
couchpotato/core/downloaders/sabnzbd/__init__.py

@ -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.',
},
],
}
],

4
couchpotato/core/downloaders/sabnzbd/main.py

@ -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'))

7
couchpotato/core/downloaders/transmission/__init__.py

@ -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.',
},
],
}
],

4
couchpotato/core/downloaders/transmission/main.py

@ -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'))

2
couchpotato/core/plugins/release/main.py

@ -147,7 +147,7 @@ class Release(Plugin):
'releases': {'status': {}, 'quality': {}},
'library': {'titles': {}, 'files':{}},
'files': {}
}))
}), manual = True)
return jsonified({
'success': True

4
couchpotato/core/plugins/searcher/main.py

@ -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:

Loading…
Cancel
Save