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

SoundCloud Export & Lookup #147

Merged
merged 22 commits into from
Aug 30, 2024
Merged

Conversation

rimma-kubanova
Copy link
Contributor

@rimma-kubanova rimma-kubanova commented Aug 6, 2024

PR Status: In Progress

  • Developed a SoundCloud API class to manage SoundCloud interactions.

  • Implemented SoundCloud lookup features, including:

    • Fixes for unplayable tracks.
    • SoundCloud Labs API ID lookup.
    • Submission functionality to SoundCloud.
  • test lookup functionality

  • test rate limits

@rimma-kubanova rimma-kubanova marked this pull request as ready for review August 22, 2024 15:28
@rimma-kubanova
Copy link
Contributor Author

I updated this PR

  • Integrated SoundCloud export (can successfully create playlists in SoundCloud and put tracks into it)

  • SoundCloud lookup (still needs some tweaking, since lookup doesnt always finds songs. I guess it just needs more data to work with. OVERALL the logic is implemented)

@amCap1712 amCap1712 changed the title SoundCloud Export && Lookup SoundCloud Export & Lookup Aug 23, 2024
Copy link
Member

@amCap1712 amCap1712 left a comment

Choose a reason for hiding this comment

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

The api calls should use linked_partitioning=true where relevant, the format of the JSON response changes if you pass the query param so be sure to test the patches again and update the code that accesses the JSON.

You can find an example here of how to paginate with linked_partitioning: https://github.com/metabrainz/listenbrainz-server/blob/f0334debe2b003cc36a6d94765442bf3be0a34d5/listenbrainz/metadata_cache/soundcloud/handler.py#L66-L109.

@amCap1712
Copy link
Member

Also, the code to use soundcloud export using CLI was missing. I added it myself because I needed it for testing.

troi/tools/utils.py Outdated Show resolved Hide resolved
@rimma-kubanova
Copy link
Contributor Author

@amCap1712 Thanks for the feedback! Working on it. Completely forgot about cli, will add them to others then

@rimma-kubanova
Copy link
Contributor Author

@amCap1712 hi! I updated the code

troi/tools/utils.py Outdated Show resolved Hide resolved
troi/tools/utils.py Outdated Show resolved Hide resolved
troi/tools/utils.py Outdated Show resolved Hide resolved
Copy link
Member

@amCap1712 amCap1712 left a comment

Choose a reason for hiding this comment

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

Once these changes are done, I'll do a retest to ensure playlist exports work and then we can merge it.

@rimma-kubanova
Copy link
Contributor Author

@amCap1712 Thanks for your feedback! I've implemented all the changes you requested.

I also made some additional tweaks and identified a few errors. The fixup_soundcloud_playlist function should now work properly, including handling unplayable tracks.

The only thing I'm facing is that the Labs Lookup api retrieves soundcloud ids for only a limited number of songs, which makes testing a bit difficult

@amCap1712 amCap1712 merged commit 52171f2 into metabrainz:main Aug 30, 2024
4 of 5 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.

2 participants