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

Feature/downloadstation torrent path #9482

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions medusa/clients/torrent/deluge.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def read_torrent_status(torrent_data):
class DelugeAPI(GenericClient):
"""Deluge API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Constructor.

:param host:
Expand All @@ -116,7 +116,7 @@ def __init__(self, host=None, username=None, password=None):
:param password:
:type password: string
"""
super(DelugeAPI, self).__init__('Deluge', host, username, password)
super(DelugeAPI, self).__init__('Deluge', host, username, password, torrent_path)
self.session.headers.update({'Content-Type': 'application/json'})
self.url = urljoin(self.host, 'json')

Expand Down
4 changes: 2 additions & 2 deletions medusa/clients/torrent/deluged.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class DelugeDAPI(GenericClient):
"""Deluge Daemon API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Deluge deamon Constructor.

:param host:
Expand All @@ -38,7 +38,7 @@ def __init__(self, host=None, username=None, password=None):
:param password:
:type password: string
"""
super(DelugeDAPI, self).__init__('DelugeD', host, username, password)
super(DelugeDAPI, self).__init__('DelugeD', host, username, password, torrent_path)
self.drpc = None

self._get_auth()
Expand Down
4 changes: 2 additions & 2 deletions medusa/clients/torrent/mlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class MLNetAPI(GenericClient):
"""MLDonkey API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Constructor.

:param host:
Expand All @@ -20,7 +20,7 @@ def __init__(self, host=None, username=None, password=None):
:param password:
:type password: string
"""
super(MLNetAPI, self).__init__('mlnet', host, username, password)
super(MLNetAPI, self).__init__('mlnet', host, username, password, torrent_path)
self.url = self.host
# self.session.auth = HTTPDigestAuth(self.username, self.password);

Expand Down
4 changes: 2 additions & 2 deletions medusa/clients/torrent/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class APIUnavailableError(Exception):
class QBittorrentAPI(GenericClient):
"""qBittorrent API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Constructor.

:param host:
Expand All @@ -39,7 +39,7 @@ def __init__(self, host=None, username=None, password=None):
:param password:
:type password: string
"""
super(QBittorrentAPI, self).__init__('qBittorrent', host, username, password)
super(QBittorrentAPI, self).__init__('qBittorrent', host, username, password, torrent_path)
self.url = self.host
# Auth for API v1.0.0 (qBittorrent v3.1.x and older)
self.session.auth = HTTPDigestAuth(self.username, self.password)
Expand Down
4 changes: 2 additions & 2 deletions medusa/clients/torrent/rtorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class RTorrentAPI(GenericClient):
"""rTorrent API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Constructor.

:param host:
Expand All @@ -31,7 +31,7 @@ def __init__(self, host=None, username=None, password=None):
:param password:
:type password: string
"""
super(RTorrentAPI, self).__init__('rTorrent', host, username, password)
super(RTorrentAPI, self).__init__('rTorrent', host, username, password, torrent_path)
self._get_auth()

def _get_auth(self):
Expand Down
2 changes: 1 addition & 1 deletion medusa/clients/torrent/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class TransmissionAPI(GenericClient):
"""Transmission API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Transmission constructor.

:param host:
Expand Down
4 changes: 2 additions & 2 deletions medusa/clients/torrent/utorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_torrent_subfolder(result):
class UTorrentAPI(GenericClient):
"""uTorrent API class."""

def __init__(self, host=None, username=None, password=None):
def __init__(self, host=None, username=None, password=None, torrent_path=None):
"""Utorrent constructor.

:param host:
Expand All @@ -62,7 +62,7 @@ def __init__(self, host=None, username=None, password=None):
:param password:
:type password: string
"""
super(UTorrentAPI, self).__init__('uTorrent', host, username, password)
super(UTorrentAPI, self).__init__('uTorrent', host, username, password, torrent_path)
self.url = urljoin(self.host, 'gui/')
self._torrents_list = []
self._torrents_epoch = 0.0
Expand Down
4 changes: 2 additions & 2 deletions medusa/server/web/home/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ def testNZBget(host=None, username=None, password=None, use_https=False):
return 'Unable to connect to host'

@staticmethod
def testTorrent(torrent_method=None, host=None, username=None, password=None):
def testTorrent(torrent_method=None, host=None, username=None, password=None, torrent_path=None):
# @TODO: Move this to the validation section of each PATCH/PUT method for torrents
host = config.clean_url(host)

try:
client = torrent.get_client_class(torrent_method)

_, acces_msg = client(host, username, password).test_authentication()
_, acces_msg = client(host, username, password, torrent_path).test_authentication()
except Exception as error:
logger.log('Error while testing {torrent} connection: {error}'.format(
torrent=torrent_method or 'torrent', error=error), logger.WARNING)
Expand Down
5 changes: 3 additions & 2 deletions themes-default/slim/src/components/config-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -571,15 +571,16 @@ export default {
async testTorrentClient() {
const { clients } = this;
const { torrents } = clients;
const { method, host, username, password } = torrents;
const { method, host, username, password, path } = torrents;

this.clientsConfig.torrent[method].testStatus = MEDUSA.config.layout.loading;

const params = {
torrent_method: method, // eslint-disable-line camelcase
host,
username,
password
password,
torrent_path: path // eslint-disable-line camelcase
};
const resp = await apiRoute.get('home/testTorrent', { params });

Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/light/assets/js/medusa-runtime.js

Large diffs are not rendered by default.