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

Conversation

p0psicles
Copy link
Contributor

@p0psicles p0psicles commented Apr 3, 2021

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

Fix issue #9366

@@ -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

@p0psicles p0psicles merged commit 0fe90ae into develop Apr 4, 2021
@p0psicles p0psicles deleted the feature/fix-synology-ds branch April 4, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants