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

Support searching Soundcloud for playback in BrainzPlayer #2506

Merged
merged 16 commits into from
Aug 14, 2023
Merged

Conversation

amCap1712
Copy link
Member

@amCap1712 amCap1712 commented Jun 20, 2023

BrainzPlayer already supported SoundCloud playback if a soundcloud id was present in the original listen. Now we have access to SoundCloud search APIs, so adding search support to SoundCloud Player in BP.

Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

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

Looking good !

Hope you don't mind, I jumped in for a preliminary review of the react bits.
You can safely ignore my rambling about refactoring the refreshToken methods, they're mainly notes for myself.

Let me know if you need any UI work that I can help with.

frontend/js/src/brainzplayer/SoundcloudPlayer.tsx Outdated Show resolved Hide resolved
frontend/js/src/brainzplayer/SoundcloudPlayer.tsx Outdated Show resolved Hide resolved
@@ -86,6 +86,7 @@ export default class UserTaste extends React.Component<UserTasteProps> {
listenBrainzAPIBaseURI={APIService.APIBaseURI}
refreshSpotifyToken={APIService.refreshSpotifyToken}
refreshYoutubeToken={APIService.refreshYoutubeToken}
refreshSoundcloudToken={APIService.refreshSoundcloudToken}
Copy link
Member

Choose a reason for hiding this comment

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

This is getting really annoying, isn't it?
Since each of those functions is just calling the APIService method with the name of the service as a string, I think we should be able to refactor it (separate PR, I don't mind getting in there and doing it) and just pass the refreshAccessToken method to BrainzPlayer.

Then in BrainzPlayer we can pass the prop along, for example

<SoundcloudPlayer
  ...
  refreshToken={refreshAccessToken}

And finally, in SoundcloudPlayer, we can call this.props.refreshToken(this.name) <- the name string is already stored in the class.

Anyway, I'll have a look at refactoring that once this PR is merge, so as not to be disruptive :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense

frontend/js/src/utils/utils.tsx Outdated Show resolved Hide resolved
frontend/js/src/utils/utils.tsx Show resolved Hide resolved
frontend/js/src/utils/utils.tsx Outdated Show resolved Hide resolved
@amCap1712 amCap1712 requested a review from MonkeyDo July 26, 2023 18:50
@amCap1712 amCap1712 changed the title Integrate Soundcloud playback into ListenBrainz Support searching Soundcloud for playback in BrainzPlayer Jul 27, 2023
@amCap1712 amCap1712 marked this pull request as ready for review July 27, 2023 08:57
Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

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

Looks good, thanks !

update some test descriptions now that SoundCouldPlayer is not added by default when user is not signed into SC.

Also some minimal cleanup of invalid props passed to the BrainzPlayer component in tests.
@MonkeyDo
Copy link
Member

Server tests are failing, but apart from that I think it is ready to go into beta.

@amCap1712 amCap1712 merged commit 3c5cfa5 into master Aug 14, 2023
3 checks passed
@amCap1712 amCap1712 deleted the soundcloud branch August 14, 2023 14:10
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