Gracefully retrieve uploaded songs with a blank duration (#578) #580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #578
This prevents a possible KeyError or a int-parsing error when an uploaded song has a duration that is not a valid value like "3:31".
Per-recent changes by Google, an uploaded song can have a duration of
' '
or simply not have afixedColumns
object at all. This is most commonly seen immediately after uploading a song but can be seen in other cases as well.I added a unit test that exercises this. It uploads a song and then starts calling
get_library_upload_songs()
in a loop, waiting for the song to be available. Without my duration fix, this encounters a parsing error. With the fix, it succeeds.