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: use endwith() instead of endWith() #3598

Merged
merged 3 commits into from
May 23, 2020
Merged

fix: use endwith() instead of endWith() #3598

merged 3 commits into from
May 23, 2020

Conversation

jef
Copy link
Member

@jef jef commented May 22, 2020

Description

Fixes method call error created by this: #3449

Moved the helper static functions to the SubsonicUpdate class and made them private static.

Added tests for various of URL input and made sure that it can create a token and format URL correctly.

@jef jef marked this pull request as draft May 22, 2020 20:30
@jef
Copy link
Member Author

jef commented May 22, 2020

Working on creating some tests so we don't run into this problem again.

@sampsyo
Copy link
Member

sampsyo commented May 22, 2020

So far, so good. 😃

@jef jef marked this pull request as ready for review May 23, 2020 01:24
r = string.ascii_letters + string.digits
salt = "".join([random.choice(r) for _ in range(6)])
salted_password = password + salt
token = hashlib.md5(salted_password.encode('utf-8')).hexdigest()
Copy link
Member Author

@jef jef May 23, 2020

Choose a reason for hiding this comment

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

Also changed this, but hard to tell in GitHub diff...

Used to be hashlib.md5().update(salted_password.encode('utf-8')).hexdigest(). Seems like a better use of hashlib.

"""

url = config['subsonic']['url'].as_str()
if url and url.endswith('/'):
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the main problem.

@sampsyo
Copy link
Member

sampsyo commented May 23, 2020

Nice; looks prefect to me! Thanks!!

@sampsyo sampsyo merged commit 1b4686e into beetbox:master May 23, 2020
@jef jef deleted the jef/fix-str branch May 24, 2020 14:46
@jef
Copy link
Member Author

jef commented May 24, 2020

Thanks as always!

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.

2 participants