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

Workaround to fix an issue with DS 3.8.16.3566. #9401

Merged
merged 3 commits into from
Apr 4, 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
#### New Features

#### Improvements
- Vueify history page. ([9201](https://github.com/pymedusa/Medusa/pull/9201))
- Nebulance: Prevent duplicate results for provider. ([9333](https://github.com/pymedusa/Medusa/pull/9333))

#### Fixes
- AnimeBytes: Fix exception when processing multi-ep BD specials. ([9396](https://github.com/pymedusa/Medusa/pull/9396))
- Fix issue with sending torrents to Synology downloadstation. ([9401](https://github.com/pymedusa/Medusa/pull/9401))
- Fix a number of issues with trakt sync. ([9319](https://github.com/pymedusa/Medusa/pull/9319))

-----

Expand Down
4 changes: 4 additions & 0 deletions medusa/clients/torrent/downloadstation.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def _add_torrent_uri(self, result):
return self._check_response()

def _add_torrent_file(self, result):
# The API in the latest version of Download Station (3.8.16.-3566)
# is broken for downloading via a file, only uri's are working correct.
if result.url[:4].lower() in ['http', 'magn']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about .startswith()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startswith() make is more complex, you have to do two test one for magnet and on for http.
This code test for http, https, and magnet links.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a tuple like: .startswith(('http', 'magn'))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many ways to Rome mine is tested

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah your both right. But i'll go with as is. Tnx for the contribution @BenjV

return self._add_torrent_uri(result)

torrent_path = app.TORRENT_PATH

Expand Down