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)) ----- 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):