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

Gracefully retrieve uploaded songs with a blank duration (#578) #580

Merged
merged 6 commits into from
May 11, 2024

Conversation

apastel
Copy link
Contributor

@apastel apastel commented May 9, 2024

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 a fixedColumns 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.

@apastel apastel force-pushed the 578-error-when-duration-blank branch from 2703467 to c17924b Compare May 9, 2024 02:18
Copy link
Owner

@sigma67 sigma67 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution and work towards improving the reliability of the uploads functions :)

tests/mixins/test_uploads.py Outdated Show resolved Hide resolved
@sigma67 sigma67 force-pushed the 578-error-when-duration-blank branch from 693e8a1 to 8f1c50a Compare May 11, 2024 16:21
@sigma67 sigma67 force-pushed the 578-error-when-duration-blank branch from 8f1c50a to 80129a5 Compare May 11, 2024 16:22
@sigma67 sigma67 merged commit ae966bb into sigma67:main May 11, 2024
3 of 4 checks passed
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.

KeyError: 'fixedColumns' in specific circumstance when retrieving uploads
2 participants