-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add last.fm backend importer - interim check in #2991
base: master
Are you sure you want to change the base?
Conversation
Hello @amCap1712! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-10-25 14:58:35 UTC |
b6dce0f
to
245ab5d
Compare
@MonkeyDo need your help to add a way for users to link their last.fm account with ListenBrainz. The last.fm username is required and the time they want to start their import from is optional. The data should be posted in a JSON body like |
try: | ||
latest_listened_at = datetime.fromisoformat(data["latest_listened_at"]) | ||
except (ValueError, TypeError): | ||
raise APIBadRequest(f"Value of latest_listened_at '{data['latest_listened_at']} is invalid.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making latest_listened_at
optional
try: | |
latest_listened_at = datetime.fromisoformat(data["latest_listened_at"]) | |
except (ValueError, TypeError): | |
raise APIBadRequest(f"Value of latest_listened_at '{data['latest_listened_at']} is invalid.") | |
latest_listened_at = None | |
if data["latest_listened_at"] is not None: | |
try: | |
latest_listened_at = datetime.fromisoformat(data["latest_listened_at"]) | |
except (ValueError, TypeError): | |
raise APIBadRequest(f"Value of latest_listened_at '{data['latest_listened_at']} is invalid.") |
No description provided.