librespot-java
librespot-java copied to clipboard
Shell events don't trigger
Describe the bug Shell events doesn't trigger
To Reproduce Using this configuration, the shell commands don't get executed. I've compared the trace level logs, and there is no difference if the shell commands are enabled.
[shell]
onTrackSeeked = ""
onStartedLoading = ""
onConnectionDropped = "rm -rf /opt/hifi/spocon-connected"
onMetadataAvailable = ""
onTrackChanged = ""
onPanicState = ""
onFinishedLoading = ""
# Shell events enabled
enabled = true
onPlaybackResumed = ""
onConnectionEstablished = "touch /opt/hifi/spocon-connected"
onPlaybackEnded = ""
onContextChanged = ""
# Execute the command with `bash -c`
executeWithBash = false
onPlaybackPaused = ""
onInactiveSession = ""
onVolumeChanged = ""
Version/Commit 1.6.2
I observe the same.
I would really like to trigger something like a timeout counter when Playback ends, so my Raspberry Pi is shutdown after that period. But as @kondas already wrote: No difference in having enabled = true
or not.
PS: It's also quite hard to understand from a user perspective how this works, since close to no docs seem to exist for this. Asking in the librespot Gitter channel for details on the shell section, the only resources I got pointed to after several days are:
These are working correctly for me. I did have some troubles with them initially. You may find that setting the metadata pipe item in the configuration file to "" helps. i.e.
[player] metadataPipe = ""
FYI - I did compile from the dev branch using the instructions here https://github.com/librespot-org/librespot-java/issues/321 but this may also work with the release version too.
I am reviewing the code (I am not a java dev) and I am not entirely sure why this works. I will post any observations should I discover them.