-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Extract username from session #290
Conversation
0f63247
to
e77e0f9
Compare
Codecov Report
@@ Coverage Diff @@
## master #290 +/- ##
==========================================
- Coverage 95.39% 95.08% -0.31%
==========================================
Files 2 2
Lines 1215 1220 +5
==========================================
+ Hits 1159 1160 +1
- Misses 56 60 +4
Continue to review full report at Codecov.
|
@hugovk With this change, my application is now able to use the old behavior: network = pylast.LastFMNetwork(
api_key=settings.LASTFM_API_KEY,
api_secret=settings.LASTFM_API_SECRET,
token=token,
)
user = network.get_authenticated_user()
username = user.get_name()
print(username) Any feedback on this implementation? |
Thanks for the PR! First of all, this changes the public API.
There's quite a bit of existing third-party code out there that is expecting a single value, and this would break that code. How about adding a new method, something like this? def get_web_auth_session_key_and_username(self, url, token=""):
# as get_web_auth_session_key is now in the PR
# ...
return session_key, username
def get_web_auth_session_key(self, url, token=""):
session_key, username = get_web_auth_session_key_and_username(url, token)
return session_key Then the existing code out there can still call Please could you also fix the lint formatting check? You can do it automatically with: pip install black
black . |
63691d0
to
aa8adfe
Compare
5470deb
to
0a38ac8
Compare
5d11b34
to
fffc647
Compare
Thank you! |
This had been released in pylast 3.1.0. Thanks again! |
@hugovk I'm still having this issue in 3.1.0 |
Fixes #274