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

Unify event handling between client, api and mopidy #92

Merged
merged 5 commits into from
Nov 26, 2019
Merged

Unify event handling between client, api and mopidy #92

merged 5 commits into from
Nov 26, 2019

Conversation

whomwah
Copy link
Member

@whomwah whomwah commented Nov 22, 2019

The event handling between the client the websocket server and mopidy has always been a bit of a work in progress. Mainly because it's a difficult one to grok. Now we've had the JB running for a few days solid with real interaction it's been easier to identify where the problems are. This PR attempts to solve them.

There is now a different event sent to the client depending on whether a connection has been made to the API or Mopidy.

The PR also brings back pause. There is an ongoing problem with Mopidy where if left paused for a long period of time, it consumes all the CPU and crashes the Pi. This appears to be related to the fact that when you pause mopidy, it keeps its connection to the Pi sounds card whereas stop releases the connection. This is reflected in the functionality. pause can be resumed from where you paused. stop on the other had stops the track and takes it back to the beginning. Because we now auto switch off the jukebox at the end of the day and don't pause the JB for long periods of time I have now added both pause and stop.

Address issue #90

@whomwah whomwah self-assigned this Nov 22, 2019
@whomwah whomwah changed the title Fixes #90 Unify event handling between mopidy and the api Nov 25, 2019
@whomwah whomwah changed the title Unify event handling between mopidy and the api Unify event handling between client, api and mopidy Nov 25, 2019
@kyanmichael kyanmichael self-requested a review November 25, 2019 14:36
Copy link

@tomajwinter tomajwinter left a comment

Choose a reason for hiding this comment

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

@whomwah Looks great 👍. Tiny points / questions.

frontend/src/components/controls/index.js Show resolved Hide resolved
backend/src/lib/transformer/index.spec.js Outdated Show resolved Hide resolved
backend/src/lib/transformer/index.js Show resolved Hide resolved
backend/src/lib/transformer/index.js Outdated Show resolved Hide resolved
backend/src/app.js Outdated Show resolved Hide resolved
backend/src/app.js Outdated Show resolved Hide resolved
backend/src/app.js Outdated Show resolved Hide resolved
backend/src/lib/transformer/index.spec.js Outdated Show resolved Hide resolved
backend/src/lib/transformer/index.spec.js Outdated Show resolved Hide resolved
frontend/src/components/controls/index.js Outdated Show resolved Hide resolved
@whomwah whomwah merged commit 05ff74f into master Nov 26, 2019
@whomwah whomwah deleted the jb90 branch November 26, 2019 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants