Fiabilize transmission import
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2021-07-11 10:51:57 +02:00
parent 2858283ffd
commit 1bb019cc13
5 changed files with 11 additions and 10 deletions

View File

@ -243,11 +243,12 @@ def admin_edit(link_id=None):
clean_titles() clean_titles()
# Transmission # Transmission
if TRANSMISSION_ENABLED and title.folder.path is not None and isinstance(instance, Nyaa): if TRANSMISSION_ENABLED and isinstance(instance, Nyaa):
download_url = link.link.replace('/view/', '/download/') + '.torrent' if title.folder.path is not None and title.folder.path != '':
torrent_path = '%s/%s' % (title.folder.path, title.name) download_url = link.link.replace('/view/', '/download/') + '.torrent'
torrent = transmission.add_torrent(download_url, download_dir=torrent_path) torrent_path = '%s/%s' % (title.folder.path, title.name)
transmission.move_torrent_data(torrent.id, torrent_path) torrent = transmission.add_torrent(download_url, download_dir=torrent_path)
transmission.move_torrent_data(torrent.id, torrent_path)
return redirect(url_for('admin')) return redirect(url_for('admin'))

View File

@ -73,7 +73,7 @@ class Nyaa(ConnectorCore):
}) })
self.on_error = False self.on_error = False
self.is_more = valid_trs and valid_trs is not len(trs) - 1 self.is_more = valid_trs and valid_trs != len(trs) - 1
@ConnectorCache.cache_data @ConnectorCache.cache_data
def is_vf(self, url): def is_vf(self, url):

View File

@ -66,7 +66,7 @@ class Pantsu(ConnectorCore):
}) })
self.on_error = False self.on_error = False
self.is_more = valid_trs and valid_trs is not len(trs) - 1 self.is_more = valid_trs and valid_trs != len(trs) - 1
@ConnectorCache.cache_data @ConnectorCache.cache_data
def is_vf(self, url): def is_vf(self, url):

View File

@ -75,7 +75,7 @@ class YggTorrent(ConnectorCore):
}) })
self.on_error = False self.on_error = False
self.is_more = valid_trs and valid_trs is not len(trs) - 1 self.is_more = valid_trs and valid_trs != len(trs) - 1
@ConnectorCache.cache_data @ConnectorCache.cache_data
def is_vf(self, url): def is_vf(self, url):

View File

@ -6,13 +6,13 @@
<div class="field is-horizontal"> <div class="field is-horizontal">
<div class="field-body"> <div class="field-body">
<div class="field column"> <div class="field column is-5">
<div class="control is-expanded"> <div class="control is-expanded">
{{ action_form.name(class='input', placeholder='Name') }} {{ action_form.name(class='input', placeholder='Name') }}
</div> </div>
</div> </div>
<div class="field column"> <div class="field column is-5">
<div class="control is-expanded"> <div class="control is-expanded">
{{ action_form.path(class='input', placeholder='Path') }} {{ action_form.path(class='input', placeholder='Path') }}
</div> </div>