From 1b66d7be27f01f5d2deec23dc045ef626be63c64 Mon Sep 17 00:00:00 2001 From: p0psicles Date: Wed, 3 Feb 2021 17:27:01 +0100 Subject: [PATCH 1/2] Fix set label qbittorrent * Requires qbit api version > 2.0.0 --- medusa/clients/torrent/qbittorrent.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/medusa/clients/torrent/qbittorrent.py b/medusa/clients/torrent/qbittorrent.py index 1518e2b6c0..9c25e7430f 100644 --- a/medusa/clients/torrent/qbittorrent.py +++ b/medusa/clients/torrent/qbittorrent.py @@ -154,6 +154,12 @@ def _add_torrent_uri(self, result): if self.api >= (2, 0, 0): if os.path.isabs(app.TORRENT_PATH): data['savepath'] = app.TORRENT_PATH + + label = app.TORRENT_LABEL_ANIME if result.series.is_anime else app.TORRENT_LABEL + + if label: + data['category'] = label + return self._request(method='post', data=data, cookies=self.session.cookies) def _add_torrent_file(self, result): @@ -167,6 +173,12 @@ def _add_torrent_file(self, result): if self.api >= (2, 0, 0): if os.path.isabs(app.TORRENT_PATH): data['savepath'] = app.TORRENT_PATH + + label = app.TORRENT_LABEL_ANIME if result.series.is_anime else app.TORRENT_LABEL + + if label: + data['category'] = label + return self._request(method='post', data=data, files=files, cookies=self.session.cookies) def _set_torrent_label(self, result): From 024c84315923fd8321f2129afd9c28abeb123baa Mon Sep 17 00:00:00 2001 From: p0psicles Date: Wed, 3 Feb 2021 17:29:52 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e0e326634..788dbed03d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ #### Improvements #### Fixes + - Fix qbittorrent labels not always set ([9165](https://github.com/pymedusa/Medusa/pull/9165)) -----