-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fixed TypeError when downloading tracks #1177
Conversation
@@ -95,7 +95,7 @@ def __map_result_to_song_data(result: dict) -> dict: | |||
'name': result['title'], | |||
'type': result['resultType'], | |||
'artist': artists, | |||
'length': __parse_duration(result['duration']), | |||
'length': __parse_duration(result.get('duration', None)), |
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.
The None
is a default return value from get()
function. You don't have to specify it.
'length': __parse_duration(result.get('duration', None)), | |
'length': __parse_duration(result.get('duration')), |
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.
See interesting point:
https://discord.com/channels/771628785447337985/771628785891672086/807519313770577920
Hi @xnetcat! Great to see you contributing around spotDL! Thanks for this contribution! :) |
* Run regressions on CI (#1158) Authored by @aklajnert * Use argparse instead of raw `sys.argv` (#1157) Authored by @aklajnert * FIxed error caused by songs with ':' in name (#1162) Authored by @MikhailZex * Fixed TypeError when downloading tracks (#1177) Authored by @xnetcat * Bump version to 3.3.2 * Lint with flake8, fix code to pass it (#1178) Authored by @aklajnert * Fixed flake8 (#1181) Authored by @aklajnert * Skip song if track is empty. (#1164) Authored by @bee395 Co-authored-by: Andrzej Klajnert <github@aklajnert.pl> Co-authored-by: Michael George <MikhailZex@gmail.com> Co-authored-by: Jakub <42355410+xnetcat@users.noreply.github.com> Co-authored-by: bee395 <bee395@users.noreply.github.com>
YMusic sometimes returns results without duration, this commit makes sure that it does not break spotdl
track: https://open.spotify.com/track/3pjUyVbFmM96tYhSaKJwTt?si=EL8F3YB4SZqfJGU267O4-g
Error: