Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding savepath for qBittorrent client #8304

Merged
merged 2 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions medusa/clients/torrent/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import unicode_literals

import logging
import os

from medusa import app
from medusa.clients.torrent.generic import GenericClient
Expand Down Expand Up @@ -150,6 +151,9 @@ def _add_torrent_uri(self, result):
data = {
'urls': result.url,
}
if self.api >= (2, 0, 0):
if os.path.isabs(app.TORRENT_PATH):
data['savepath'] = app.TORRENT_PATH
return self._request(method='post', data=data, cookies=self.session.cookies)

def _add_torrent_file(self, result):
Expand All @@ -159,6 +163,9 @@ def _add_torrent_file(self, result):
files = {
'torrents': result.content
}
if self.api >= (2, 0, 0):
if os.path.isabs(app.TORRENT_PATH):
files['savepath'] = app.TORRENT_PATH
return self._request(method='post', files=files, cookies=self.session.cookies)

def _set_torrent_label(self, result):
Expand Down
4 changes: 4 additions & 0 deletions themes-default/slim/src/components/config-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@
<p>where <span id="torrent_client" v-if="clientsConfig.torrent[clients.torrents.method]">{{clientsConfig.torrent[clients.torrents.method].shortTitle || clientsConfig.torrent[clients.torrents.method].title}}</span> will save downloaded files (blank for client default)
<span v-show="clients.torrents.method === 'downloadstation'"> <b>Note:</b> the destination has to be a shared folder for Synology DS</span>
</p>
<span v-show="clients.torrents.method === 'qbittorrent'">
<p><b>Note:</b> for qBitTorrent 3.2.0 and up</p>
</span>
</config-template>

<config-template v-show="clientsConfig.torrent[clients.torrents.method].seedLocationOption" label-for="torrent_seed_location" label="Post-Processed seeding torrents location">
Expand Down Expand Up @@ -447,6 +450,7 @@ export default {
qbittorrent: {
title: 'qBittorrent',
description: 'URL to your qBittorrent client (e.g. http://localhost:8080)',
pathOption: true,
labelOption: true,
labelAnimeOption: true,
pausedOption: true,
Expand Down
Loading