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

feat(api-server): add endpoint to get shuffle state #2792

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

franz-dc
Copy link
Contributor

Added API endpoint: /api/v1/shuffle (GET)

canSetFullscreen has been renamed to canUsePlayerControls to be used by other player control states other than fullscreen. Can be reverted back if that's not the desired outcome.

@JellyBrick JellyBrick added the enhancement New feature or request label Dec 28, 2024
@JellyBrick JellyBrick requested review from Su-Yong and JellyBrick and removed request for Su-Yong December 28, 2024 14:30
@ArjixWasTaken
Copy link
Contributor

ArjixWasTaken commented Jan 1, 2025

You should use ipc.handle and ipc.invoke instead of ipc.send() and ipc.once()

e.g.

- backend.ts
- renderer.ts

That way you won't care about race conditions, although in this particular case, a race condition should not be a big issue.

Edit: Actually, a race condition could cause an issue, your promise may never resolve when a race condition happens, now, I doubt that would happen, since it is a locally hosted API, but we should not take such risks.

Edit 2:
Oh I see, the renderer thread is what "handles" the request, that's why you did it this way.
So I assume electron doesn't support for the renderer to "handle" an event, because there can be multiple renderers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants