Browse Source

Merge branch 'refs/heads/seeding' into develop

pull/1921/merge
Ruud 12 years ago
parent
commit
63f72eb23b
  1. 8
      couchpotato/core/downloaders/base.py
  2. 1
      couchpotato/core/downloaders/blackhole/main.py
  3. 2
      couchpotato/core/downloaders/nzbget/__init__.py
  4. 1
      couchpotato/core/downloaders/nzbget/main.py
  5. 1
      couchpotato/core/downloaders/nzbvortex/__init__.py
  6. 1
      couchpotato/core/downloaders/nzbvortex/main.py
  7. 1
      couchpotato/core/downloaders/pneumatic/main.py
  8. 4
      couchpotato/core/downloaders/sabnzbd/__init__.py
  9. 1
      couchpotato/core/downloaders/sabnzbd/main.py
  10. 19
      couchpotato/core/downloaders/transmission/__init__.py
  11. 9
      couchpotato/core/downloaders/transmission/main.py
  12. 18
      couchpotato/core/downloaders/utorrent/__init__.py
  13. 22
      couchpotato/core/downloaders/utorrent/main.py
  14. 2
      couchpotato/core/notifications/twitter/main.py
  15. 47
      couchpotato/core/plugins/renamer/main.py
  16. 2
      couchpotato/core/plugins/subtitle/main.py
  17. 4
      couchpotato/core/providers/torrent/awesomehd/__init__.py
  18. 4
      couchpotato/core/providers/torrent/hdbits/__init__.py
  19. 4
      couchpotato/core/providers/torrent/iptorrents/__init__.py
  20. 4
      couchpotato/core/providers/torrent/kickasstorrents/__init__.py
  21. 4
      couchpotato/core/providers/torrent/passthepopcorn/__init__.py
  22. 4
      couchpotato/core/providers/torrent/publichd/__init__.py
  23. 4
      couchpotato/core/providers/torrent/sceneaccess/__init__.py
  24. 4
      couchpotato/core/providers/torrent/scenehd/__init__.py
  25. 4
      couchpotato/core/providers/torrent/thepiratebay/__init__.py
  26. 4
      couchpotato/core/providers/torrent/torrentbytes/__init__.py
  27. 4
      couchpotato/core/providers/torrent/torrentday/__init__.py
  28. 4
      couchpotato/core/providers/torrent/torrentleech/__init__.py
  29. 4
      couchpotato/core/providers/torrent/torrentshack/__init__.py
  30. 4
      couchpotato/core/providers/torrent/yify/__init__.py

8
couchpotato/core/downloaders/base.py

@ -82,11 +82,12 @@ class Downloader(Provider):
return return
if item and item.get('downloader') == self.getName(): if item and item.get('downloader') == self.getName():
if self.conf('remove_complete'): if self.conf('remove_complete', default = False):
return self.processComplete(item = item, delete_files = self.conf('delete_files', default = False)) return self.processComplete(item = item, delete_files = self.conf('delete_files', default = False))
return False return False
return
return False
def processComplete(self, item, delete_files): def processComplete(self, item, delete_files):
return return
@ -149,7 +150,8 @@ class Downloader(Provider):
if item and item.get('downloader') == self.getName(): if item and item.get('downloader') == self.getName():
self.pause(item, pause) self.pause(item, pause)
return True return True
return
return False
def pause(self, item, pause): def pause(self, item, pause):
return return

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

@ -7,6 +7,7 @@ import traceback
log = CPLog(__name__) log = CPLog(__name__)
class Blackhole(Downloader): class Blackhole(Downloader):
type = ['nzb', 'torrent', 'torrent_magnet'] type = ['nzb', 'torrent', 'torrent_magnet']

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

@ -42,6 +42,7 @@ config = [{
}, },
{ {
'name': 'priority', 'name': 'priority',
'advanced': True,
'default': '0', 'default': '0',
'type': 'dropdown', 'type': 'dropdown',
'values': [('Very Low', -100), ('Low', -50), ('Normal', 0), ('High', 50), ('Very High', 100)], 'values': [('Very Low', -100), ('Low', -50), ('Normal', 0), ('High', 50), ('Very High', 100)],
@ -57,6 +58,7 @@ config = [{
{ {
'name': 'delete_failed', 'name': 'delete_failed',
'default': True, 'default': True,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Delete a release after the download has failed.', 'description': 'Delete a release after the download has failed.',
}, },

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

@ -12,6 +12,7 @@ import xmlrpclib
log = CPLog(__name__) log = CPLog(__name__)
class NZBGet(Downloader): class NZBGet(Downloader):
type = ['nzb'] type = ['nzb']

1
couchpotato/core/downloaders/nzbvortex/__init__.py

@ -38,6 +38,7 @@ config = [{
{ {
'name': 'delete_failed', 'name': 'delete_failed',
'default': True, 'default': True,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Delete a release after the download has failed.', 'description': 'Delete a release after the download has failed.',
}, },

1
couchpotato/core/downloaders/nzbvortex/main.py

@ -16,6 +16,7 @@ import urllib2
log = CPLog(__name__) log = CPLog(__name__)
class NZBVortex(Downloader): class NZBVortex(Downloader):
type = ['nzb'] type = ['nzb']

1
couchpotato/core/downloaders/pneumatic/main.py

@ -6,6 +6,7 @@ import traceback
log = CPLog(__name__) log = CPLog(__name__)
class Pneumatic(Downloader): class Pneumatic(Downloader):
type = ['nzb'] type = ['nzb']

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

@ -43,14 +43,16 @@ config = [{
}, },
{ {
'name': 'remove_complete', 'name': 'remove_complete',
'advanced': True,
'label': 'Remove NZB', 'label': 'Remove NZB',
'default': True, 'default': False,
'type': 'bool', 'type': 'bool',
'description': 'Remove the NZB from history after it completed.', 'description': 'Remove the NZB from history after it completed.',
}, },
{ {
'name': 'delete_failed', 'name': 'delete_failed',
'default': True, 'default': True,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Delete a release after the download has failed.', 'description': 'Delete a release after the download has failed.',
}, },

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

@ -10,6 +10,7 @@ import traceback
log = CPLog(__name__) log = CPLog(__name__)
class Sabnzbd(Downloader): class Sabnzbd(Downloader):
type = ['nzb'] type = ['nzb']

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

@ -33,27 +33,15 @@ config = [{
'type': 'password', 'type': 'password',
}, },
{ {
'name': 'paused',
'type': 'bool',
'default': False,
'description': 'Add the torrent paused.',
},
{
'name': 'directory', 'name': 'directory',
'type': 'directory', 'type': 'directory',
'description': 'Download to this directory. Keep empty for default Transmission download directory.', 'description': 'Download to this directory. Keep empty for default Transmission download directory.',
}, },
{ {
'name': 'seeding',
'label': 'Seeding support',
'default': True,
'type': 'bool',
'description': '(Hard)link/copy after download is complete (if enabled in renamer), wait for seeding to finish before (re)moving and set the seeding goal from the torrent providers.',
},
{
'name': 'remove_complete', 'name': 'remove_complete',
'label': 'Remove torrent', 'label': 'Remove torrent',
'default': True, 'default': False,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Remove the torrent from Transmission after it finished seeding.', 'description': 'Remove the torrent from Transmission after it finished seeding.',
}, },
@ -68,6 +56,7 @@ config = [{
{ {
'name': 'paused', 'name': 'paused',
'type': 'bool', 'type': 'bool',
'advanced': True,
'default': False, 'default': False,
'description': 'Add the torrent paused.', 'description': 'Add the torrent paused.',
}, },
@ -81,12 +70,14 @@ config = [{
{ {
'name': 'stalled_as_failed', 'name': 'stalled_as_failed',
'default': True, 'default': True,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Consider a stalled torrent as failed', 'description': 'Consider a stalled torrent as failed',
}, },
{ {
'name': 'delete_failed', 'name': 'delete_failed',
'default': True, 'default': True,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Delete a release after the download has failed.', 'description': 'Delete a release after the download has failed.',
}, },

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

@ -26,8 +26,10 @@ class Transmission(Downloader):
if not isInt(host[1]): if not isInt(host[1]):
log.error('Config properties are not filled in correctly, port is missing.') log.error('Config properties are not filled in correctly, port is missing.')
return False return False
if not self.trpc: if not self.trpc:
self.trpc = TransmissionRPC(host[0], port = host[1], username = self.conf('username'), password = self.conf('password')) self.trpc = TransmissionRPC(host[0], port = host[1], username = self.conf('username'), password = self.conf('password'))
return self.trpc return self.trpc
def download(self, data, movie, filedata = None): def download(self, data, movie, filedata = None):
@ -53,11 +55,11 @@ class Transmission(Downloader):
# Change parameters of torrent # Change parameters of torrent
torrent_params = {} torrent_params = {}
if data.get('seed_ratio') and self.conf('seeding'): if data.get('seed_ratio'):
torrent_params['seedRatioLimit'] = tryFloat(data.get('seed_ratio')) torrent_params['seedRatioLimit'] = tryFloat(data.get('seed_ratio'))
torrent_params['seedRatioMode'] = 1 torrent_params['seedRatioMode'] = 1
if data.get('seed_time') and self.conf('seeding'): if data.get('seed_time'):
torrent_params['seedIdleLimit'] = tryInt(data.get('seed_time')) * 60 torrent_params['seedIdleLimit'] = tryInt(data.get('seed_time')) * 60
torrent_params['seedIdleMode'] = 1 torrent_params['seedIdleMode'] = 1
@ -98,7 +100,8 @@ class Transmission(Downloader):
return False return False
for item in queue['torrents']: for item in queue['torrents']:
log.debug('name=%s / id=%s / downloadDir=%s / hashString=%s / percentDone=%s / status=%s / eta=%s / uploadRatio=%s / isFinished=%s', (item['name'], item['id'], item['downloadDir'], item['hashString'], item['percentDone'], item['status'], item['eta'], item['uploadRatio'], item['isFinished'])) log.debug('name=%s / id=%s / downloadDir=%s / hashString=%s / percentDone=%s / status=%s / eta=%s / uploadRatio=%s / isFinished=%s',
(item['name'], item['id'], item['downloadDir'], item['hashString'], item['percentDone'], item['status'], item['eta'], item['uploadRatio'], item['isFinished']))
if not os.path.isdir(Env.setting('from', 'renamer')): if not os.path.isdir(Env.setting('from', 'renamer')):
log.error('Renamer "from" folder doesn\'t to exist.') log.error('Renamer "from" folder doesn\'t to exist.')

18
couchpotato/core/downloaders/utorrent/__init__.py

@ -37,16 +37,10 @@ config = [{
'description': 'Label to add torrent as.', 'description': 'Label to add torrent as.',
}, },
{ {
'name': 'seeding',
'label': 'Seeding support',
'default': True,
'type': 'bool',
'description': '(Hard)links/copies after download is complete (if enabled in renamer), wait for seeding to finish before (re)moving.',
},
{
'name': 'remove_complete', 'name': 'remove_complete',
'label': 'Remove torrent', 'label': 'Remove torrent',
'default': True, 'default': False,
'advanced': True,
'type': 'bool', 'type': 'bool',
'description': 'Remove the torrent from uTorrent after it finished seeding.', 'description': 'Remove the torrent from uTorrent after it finished seeding.',
}, },
@ -61,6 +55,7 @@ config = [{
{ {
'name': 'paused', 'name': 'paused',
'type': 'bool', 'type': 'bool',
'advanced': True,
'default': False, 'default': False,
'description': 'Add the torrent paused.', 'description': 'Add the torrent paused.',
}, },
@ -71,6 +66,13 @@ 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,
'advanced': True,
'type': 'bool',
'description': 'Delete a release after the download has failed.',
},
], ],
} }
], ],

22
couchpotato/core/downloaders/utorrent/main.py

@ -15,7 +15,6 @@ import time
import urllib import urllib
import urllib2 import urllib2
log = CPLog(__name__) log = CPLog(__name__)
@ -31,8 +30,8 @@ class uTorrent(Downloader):
log.error('Config properties are not filled in correctly, port is missing.') log.error('Config properties are not filled in correctly, port is missing.')
return False return False
if not self.utorrent_api:
self.utorrent_api = uTorrentAPI(host[0], port = host[1], username = self.conf('username'), password = self.conf('password')) self.utorrent_api = uTorrentAPI(host[0], port = host[1], username = self.conf('username'), password = self.conf('password'))
return self.utorrent_api return self.utorrent_api
def download(self, data, movie, filedata = None): def download(self, data, movie, filedata = None):
@ -42,19 +41,23 @@ class uTorrent(Downloader):
if not self.connect(): if not self.connect():
return False return False
print 'test'
settings = self.utorrent_api.get_settings() settings = self.utorrent_api.get_settings()
if not settings: if not settings:
return False return False
#Fix settings in case they are not set for CPS compatibility #Fix settings in case they are not set for CPS compatibility
new_settings = {} new_settings = {}
if self.conf('seeding') and not (settings.get('seed_prio_limitul') == 0 and settings['seed_prio_limitul_flag']): if not (settings.get('seed_prio_limitul') == 0 and settings['seed_prio_limitul_flag']):
new_settings['seed_prio_limitul'] = 0 new_settings['seed_prio_limitul'] = 0
new_settings['seed_prio_limitul_flag'] = True new_settings['seed_prio_limitul_flag'] = True
log.info('Updated uTorrent settings to set a torrent to complete after it the seeding requirements are met.') log.info('Updated uTorrent settings to set a torrent to complete after it the seeding requirements are met.')
if settings.get('bt.read_only_on_complete'): #This doesnt work as this option seems to be not available through the api if settings.get('bt.read_only_on_complete'): #This doesnt work as this option seems to be not available through the api
new_settings['bt.read_only_on_complete'] = False new_settings['bt.read_only_on_complete'] = False
log.info('Updated uTorrent settings to not set the files to read only after completing.') log.info('Updated uTorrent settings to not set the files to read only after completing.')
if new_settings: if new_settings:
self.utorrent_api.set_settings(new_settings) self.utorrent_api.set_settings(new_settings)
@ -74,11 +77,11 @@ class uTorrent(Downloader):
torrent_hash = sha1(bencode(info)).hexdigest().upper() torrent_hash = sha1(bencode(info)).hexdigest().upper()
torrent_filename = self.createFileName(data, filedata, movie) torrent_filename = self.createFileName(data, filedata, movie)
if data.get('seed_ratio') and self.conf('seeding'): if data.get('seed_ratio'):
torrent_params['seed_override'] = 1 torrent_params['seed_override'] = 1
torrent_params['seed_ratio'] = tryInt(tryFloat(data['seed_ratio']) * 1000) torrent_params['seed_ratio'] = tryInt(tryFloat(data['seed_ratio']) * 1000)
if data.get('seed_time') and self.conf('seeding'): if data.get('seed_time'):
torrent_params['seed_override'] = 1 torrent_params['seed_override'] = 1
torrent_params['seed_time'] = tryInt(data['seed_time']) * 3600 torrent_params['seed_time'] = tryInt(data['seed_time']) * 3600
@ -130,10 +133,7 @@ class uTorrent(Downloader):
if 'Finished' in item[21]: if 'Finished' in item[21]:
status = 'completed' status = 'completed'
elif 'Seeding' in item[21]: elif 'Seeding' in item[21]:
if self.conf('seeding'):
status = 'seeding' status = 'seeding'
else:
status = 'completed'
statuses.append({ statuses.append({
'id': item[0], 'id': item[0],
@ -152,6 +152,12 @@ class uTorrent(Downloader):
return False return False
return self.utorrent_api.pause_torrent(download_info['id'], pause) return self.utorrent_api.pause_torrent(download_info['id'], pause)
def removeFailed(self, item):
log.info('%s failed downloading, deleting...', item['name'])
if not self.connect():
return False
return self.utorrent_api.remove_torrent(item['id'], remove_data = True)
def processComplete(self, item, delete_files = False): def processComplete(self, item, delete_files = False):
log.debug('Requesting uTorrent to remove the torrent %s%s.', (item['name'], ' and cleanup the downloaded files' if delete_files else '')) log.debug('Requesting uTorrent to remove the torrent %s%s.', (item['name'], ' and cleanup the downloaded files' if delete_files else ''))
if not self.connect(): if not self.connect():

2
couchpotato/core/notifications/twitter/main.py

@ -50,7 +50,7 @@ class Twitter(Notification):
try: try:
if direct_message: if direct_message:
for user in direct_message_users.split(): for user in direct_message_users.split():
api.PostDirectMessage(user, '[%s] %s' % (self.default_title, message)) api.PostDirectMessage('[%s] %s' % (self.default_title, message), screen_name = user)
else: else:
update_message = '[%s] %s' % (self.default_title, message) update_message = '[%s] %s' % (self.default_title, message)
if len(update_message) > 140: if len(update_message) > 140:

47
couchpotato/core/plugins/renamer/main.py

@ -151,7 +151,7 @@ class Renamer(Plugin):
# Add _UNKNOWN_ if no library item is connected # Add _UNKNOWN_ if no library item is connected
if not group['library'] or not movie_title: if not group['library'] or not movie_title:
self.tagDir(group['parentdir'], 'unknown') self.tagDir(group, 'unknown')
continue continue
# Rename the files using the library data # Rename the files using the library data
else: else:
@ -164,6 +164,7 @@ class Renamer(Plugin):
movie_title = getTitle(library) movie_title = getTitle(library)
# Find subtitle for renaming # Find subtitle for renaming
group['before_rename'] = []
fireEvent('renamer.before', group) fireEvent('renamer.before', group)
# Remove weird chars from moviename # Remove weird chars from moviename
@ -361,7 +362,7 @@ class Renamer(Plugin):
log.info('Better quality release already exists for %s, with quality %s', (movie.library.titles[0].title, release.quality.label)) log.info('Better quality release already exists for %s, with quality %s', (movie.library.titles[0].title, release.quality.label))
# Add exists tag to the .ignore file # Add exists tag to the .ignore file
self.tagDir(group['parentdir'], 'exists') self.tagDir(group, 'exists')
# Notify on rename fail # Notify on rename fail
download_message = 'Renaming of %s (%s) canceled, exists in %s already.' % (movie.library.titles[0].title, group['meta_data']['quality']['label'], release.quality.label) download_message = 'Renaming of %s (%s) canceled, exists in %s already.' % (movie.library.titles[0].title, group['meta_data']['quality']['label'], release.quality.label)
@ -412,7 +413,7 @@ class Renamer(Plugin):
except: except:
log.error('Failed removing %s: %s', (src, traceback.format_exc())) log.error('Failed removing %s: %s', (src, traceback.format_exc()))
self.tagDir(group['parentdir'], 'failed_remove') self.tagDir(group, 'failed_remove')
# Delete leftover folder from older releases # Delete leftover folder from older releases
for delete_folder in delete_folders: for delete_folder in delete_folders:
@ -436,12 +437,12 @@ class Renamer(Plugin):
group['renamed_files'].append(dst) group['renamed_files'].append(dst)
except: except:
log.error('Failed moving the file "%s" : %s', (os.path.basename(src), traceback.format_exc())) log.error('Failed moving the file "%s" : %s', (os.path.basename(src), traceback.format_exc()))
self.tagDir(group['parentdir'], 'failed_rename') self.tagDir(group, 'failed_rename')
# Tag folder if it is in the 'from' folder and it will not be removed because it is a torrent # Tag folder if it is in the 'from' folder and it will not be removed because it is a torrent
if (movie_folder and self.conf('from') in movie_folder or not movie_folder) and \ if (movie_folder and self.conf('from') in movie_folder or not movie_folder) and \
self.conf('file_action') != 'move' and self.downloadIsTorrent(download_info): self.conf('file_action') != 'move' and self.downloadIsTorrent(download_info):
self.tagDir(group['parentdir'], 'renamed_already') self.tagDir(group, 'renamed_already')
# Remove matching releases # Remove matching releases
for release in remove_releases: for release in remove_releases:
@ -451,7 +452,7 @@ class Renamer(Plugin):
except: except:
log.error('Failed removing %s: %s', (release.identifier, traceback.format_exc())) log.error('Failed removing %s: %s', (release.identifier, traceback.format_exc()))
if group['dirname'] and group['parentdir']: if group['dirname'] and group['parentdir'] and self.conf('file_action') == 'move':
try: try:
log.info('Deleting folder: %s', group['parentdir']) log.info('Deleting folder: %s', group['parentdir'])
self.deleteEmptyFolder(group['parentdir']) self.deleteEmptyFolder(group['parentdir'])
@ -489,9 +490,18 @@ class Renamer(Plugin):
return rename_files return rename_files
# This adds a file to ignore / tag a release so it is ignored later # This adds a file to ignore / tag a release so it is ignored later
def tagDir(self, folder, tag): def tagDir(self, group, tag):
if not os.path.isdir(folder) or not tag:
ignore_file = None
if isinstance(group, (dict)):
for movie_file in sorted(list(group['files']['movie'])):
ignore_file = '%s.%s.ignore' % (os.path.splitext(movie_file)[0], tag)
break
else:
if not os.path.isdir(group) or not tag:
return return
ignore_file = os.path.join(group, '%s.ignore' % tag)
text = """This file is from CouchPotato text = """This file is from CouchPotato
It has marked this release as "%s" It has marked this release as "%s"
@ -499,7 +509,8 @@ This file hides the release from the renamer
Remove it if you want it to be renamed (again, or at least let it try again) Remove it if you want it to be renamed (again, or at least let it try again)
""" % tag """ % tag
self.createFile(os.path.join(folder, '%s.ignore' % tag), text) if ignore_file:
self.createFile(ignore_file, text)
def untagDir(self, folder, tag = None): def untagDir(self, folder, tag = None):
if not os.path.isdir(folder): if not os.path.isdir(folder):
@ -632,17 +643,6 @@ Remove it if you want it to be renamed (again, or at least let it try again)
for rel in rels: for rel in rels:
rel_dict = rel.to_dict({'info': {}}) rel_dict = rel.to_dict({'info': {}})
# Get current selected title
default_title = getTitle(rel.movie.library)
# Check if movie has already completed and is manage tab (legacy db correction)
if rel.movie.status_id == done_status.get('id') and rel.status_id == snatched_status.get('id'):
log.debug('Found a completed movie with a snatched release : %s. Setting release status to ignored...' , default_title)
rel.status_id = ignored_status.get('id')
rel.last_edit = int(time.time())
db.commit()
continue
movie_dict = fireEvent('movie.get', rel.movie_id, single = True) movie_dict = fireEvent('movie.get', rel.movie_id, single = True)
# check status # check status
@ -668,8 +668,8 @@ Remove it if you want it to be renamed (again, or at least let it try again)
if item['folder'] and self.conf('from') in item['folder']: if item['folder'] and self.conf('from') in item['folder']:
self.tagDir(item['folder'], 'downloading') self.tagDir(item['folder'], 'downloading')
pass
elif item['status'] == 'seeding': elif item['status'] == 'seeding':
#If linking setting is enabled, process release #If linking setting is enabled, process release
if self.conf('file_action') != 'move' and not rel.movie.status_id == done_status.get('id') and item['id'] and item['downloader'] and item['folder']: if self.conf('file_action') != 'move' and not rel.movie.status_id == done_status.get('id') and item['id'] and item['downloader'] and item['folder']:
log.info('Download of %s completed! It is now being processed while leaving the original files alone for seeding. Current ratio: %s.', (item['name'], item['seed_ratio'])) log.info('Download of %s completed! It is now being processed while leaving the original files alone for seeding. Current ratio: %s.', (item['name'], item['seed_ratio']))
@ -692,7 +692,6 @@ Remove it if you want it to be renamed (again, or at least let it try again)
#let it seed #let it seed
log.debug('%s is seeding with ratio: %s', (item['name'], item['seed_ratio'])) log.debug('%s is seeding with ratio: %s', (item['name'], item['seed_ratio']))
pass
elif item['status'] == 'failed': elif item['status'] == 'failed':
fireEvent('download.remove_failed', item, single = True) fireEvent('download.remove_failed', item, single = True)
rel.status_id = failed_status.get('id') rel.status_id = failed_status.get('id')
@ -805,7 +804,7 @@ Remove it if you want it to be renamed (again, or at least let it try again)
return download_info and download_info.get('type') in ['torrent', 'torrent_magnet'] return download_info and download_info.get('type') in ['torrent', 'torrent_magnet']
def fileIsAdded(self, src, group): def fileIsAdded(self, src, group):
if not group['files'].get('added'): if not group or not group.get('before_rename'):
return False return False
return src in group['files']['added'] return src in group['before_rename']

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

@ -60,7 +60,7 @@ class Subtitle(Plugin):
for d_sub in downloaded: for d_sub in downloaded:
log.info('Found subtitle (%s): %s', (d_sub.language.alpha2, files)) log.info('Found subtitle (%s): %s', (d_sub.language.alpha2, files))
group['files']['subtitle'].append(d_sub.path) group['files']['subtitle'].append(d_sub.path)
group['files']['added'].append(d_sub.path) group['before_rename'].append(d_sub.path)
group['subtitle_language'][d_sub.path] = [d_sub.language.alpha2] group['subtitle_language'][d_sub.path] = [d_sub.language.alpha2]
return True return True

4
couchpotato/core/providers/torrent/awesomehd/__init__.py

@ -28,14 +28,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'only_internal', 'name': 'only_internal',

4
couchpotato/core/providers/torrent/hdbits/__init__.py

@ -36,14 +36,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/iptorrents/__init__.py

@ -39,14 +39,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/kickasstorrents/__init__.py

@ -24,14 +24,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/passthepopcorn/__init__.py

@ -67,14 +67,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/publichd/__init__.py

@ -24,14 +24,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/sceneaccess/__init__.py

@ -33,14 +33,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/scenehd/__init__.py

@ -33,14 +33,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/thepiratebay/__init__.py

@ -30,14 +30,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/torrentbytes/__init__.py

@ -33,14 +33,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/torrentday/__init__.py

@ -33,14 +33,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/torrentleech/__init__.py

@ -33,14 +33,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

4
couchpotato/core/providers/torrent/torrentshack/__init__.py

@ -32,14 +32,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'scene_only', 'name': 'scene_only',

4
couchpotato/core/providers/torrent/yify/__init__.py

@ -24,14 +24,14 @@ config = [{
'label': 'Seed ratio', 'label': 'Seed ratio',
'type': 'float', 'type': 'float',
'default': 1, 'default': 1,
'description': 'Torrent will not be (re)moved until this seed ratio is met.', 'description': 'Will not be (re)moved until this seed ratio is met.',
}, },
{ {
'name': 'seed_time', 'name': 'seed_time',
'label': 'Seed time', 'label': 'Seed time',
'type': 'int', 'type': 'int',
'default': 40, 'default': 40,
'description': 'Torrent will not be (re)moved until this seed time (in hours) is met.', 'description': 'Will not be (re)moved until this seed time (in hours) is met.',
}, },
{ {
'name': 'extra_score', 'name': 'extra_score',

Loading…
Cancel
Save