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

Fix set label qbittorrent #9165

Merged
merged 2 commits into from
Feb 3, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### Improvements

#### Fixes
- Fix qbittorrent labels not always set ([9165](https://github.com/pymedusa/Medusa/pull/9165))

-----

Expand Down
12 changes: 12 additions & 0 deletions medusa/clients/torrent/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down