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()
# Transmission
if TRANSMISSION_ENABLED and title.folder.path is not None and isinstance(instance, Nyaa):
download_url = link.link.replace('/view/', '/download/') + '.torrent'
torrent_path = '%s/%s' % (title.folder.path, title.name)
torrent = transmission.add_torrent(download_url, download_dir=torrent_path)
transmission.move_torrent_data(torrent.id, torrent_path)
if TRANSMISSION_ENABLED and isinstance(instance, Nyaa):
if title.folder.path is not None and title.folder.path != '':
download_url = link.link.replace('/view/', '/download/') + '.torrent'
torrent_path = '%s/%s' % (title.folder.path, title.name)
torrent = transmission.add_torrent(download_url, download_dir=torrent_path)
transmission.move_torrent_data(torrent.id, torrent_path)
return redirect(url_for('admin'))

View File

@ -73,7 +73,7 @@ class Nyaa(ConnectorCore):
})
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
def is_vf(self, url):

View File

@ -66,7 +66,7 @@ class Pantsu(ConnectorCore):
})
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
def is_vf(self, url):

View File

@ -75,7 +75,7 @@ class YggTorrent(ConnectorCore):
})
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
def is_vf(self, url):

View File

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