Merge pull request #3039 from fuzeman/feature/dev_rtorrent
[rtorrent] Removed broken ratio group usage
This commit is contained in:
@@ -94,44 +94,6 @@ class rTorrent(Downloader):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def updateProviderGroup(self, name, data):
|
|
||||||
if data.get('seed_time'):
|
|
||||||
log.info('seeding time ignored, not supported')
|
|
||||||
|
|
||||||
if not name:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if not self.connect():
|
|
||||||
return False
|
|
||||||
|
|
||||||
views = self.rt.get_views()
|
|
||||||
|
|
||||||
if name not in views:
|
|
||||||
self.rt.create_group(name)
|
|
||||||
|
|
||||||
group = self.rt.get_group(name)
|
|
||||||
|
|
||||||
try:
|
|
||||||
if data.get('seed_ratio'):
|
|
||||||
ratio = int(float(data.get('seed_ratio')) * 100)
|
|
||||||
log.debug('Updating provider ratio to %s, group name: %s', (ratio, name))
|
|
||||||
|
|
||||||
# Explicitly set all group options to ensure it is setup correctly
|
|
||||||
group.set_upload('1M')
|
|
||||||
group.set_min(ratio)
|
|
||||||
group.set_max(ratio)
|
|
||||||
group.set_command('d.stop')
|
|
||||||
group.enable()
|
|
||||||
else:
|
|
||||||
# Reset group action and disable it
|
|
||||||
group.set_command()
|
|
||||||
group.disable()
|
|
||||||
except MethodError as err:
|
|
||||||
log.error('Unable to set group options: %s', err.msg)
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def download(self, data = None, media = None, filedata = None):
|
def download(self, data = None, media = None, filedata = None):
|
||||||
if not media: media = {}
|
if not media: media = {}
|
||||||
@@ -142,10 +104,6 @@ class rTorrent(Downloader):
|
|||||||
if not self.connect():
|
if not self.connect():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
group_name = 'cp_' + data.get('provider').lower()
|
|
||||||
if not self.updateProviderGroup(group_name, data):
|
|
||||||
return False
|
|
||||||
|
|
||||||
torrent_params = {}
|
torrent_params = {}
|
||||||
if self.conf('label'):
|
if self.conf('label'):
|
||||||
torrent_params['label'] = self.conf('label')
|
torrent_params['label'] = self.conf('label')
|
||||||
@@ -186,9 +144,6 @@ class rTorrent(Downloader):
|
|||||||
if self.conf('directory'):
|
if self.conf('directory'):
|
||||||
torrent.set_directory(self.conf('directory'))
|
torrent.set_directory(self.conf('directory'))
|
||||||
|
|
||||||
# Set Ratio Group
|
|
||||||
torrent.set_visible(group_name)
|
|
||||||
|
|
||||||
# Start torrent
|
# Start torrent
|
||||||
if not self.conf('paused', default = 0):
|
if not self.conf('paused', default = 0):
|
||||||
torrent.start()
|
torrent.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user