mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #527] Duplicate event playing with "onevent" #337
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#337
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @all3kcis on GitHub (Sep 29, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/527
I added "onenvent" param and when a test with something like :
I get :
And if I change song :
Why "playing" event is raised in the same time ?
I think I used V 0.1.3, but how can I check that ?
I would like to execute an action on "playing".
to turn on the amp with a CEC control
But if the event is raised twice, this can be a problem.
@JasonLG1979 commented on GitHub (Oct 6, 2020):
It's not a perfect solution but why not just throttle the playing event if all your getting is double events?
@all3kcis commented on GitHub (Oct 8, 2020):
In the end, I didn't need the "playing" event for what I wanted to do, just start/stop.
But the question remains open about the duplication of the "playing" event.
Maybe it should sometimes be "on_playing" versus "start_playing".
@JasonLG1979 commented on GitHub (Oct 8, 2020):
I don't know, maybe it represents the latency between when it received the instruction to play vs when playback actually began?
@kingosticks commented on GitHub (Oct 8, 2020):
Playingsounds like the wrong event for what you want:github.com/librespot-org/librespot@a2f832dff1/playback/src/player.rs (L104-L116)Startedsounds more suited to your use-case:github.com/librespot-org/librespot@a2f832dff1/playback/src/player.rs (L85-L91)Do you see that initial
Startedevent?@all3kcis commented on GitHub (Oct 9, 2020):
As I said, in my case yes, I used only the "started" event.
Thanks for the quotes, I conclude that even if it's astonishing it's the expected behaviour.
@kingosticks commented on GitHub (Oct 9, 2020):
We can close this then.