Closed caiocotts closed 4 months ago
Yes, you're absolutely correct. I don't like the fact that the event is called several times, but it shouldn't be a problem because the submission is "now playing" type. Forgive me if I edited your PR last time, I was hoping to do something different but equally clean, but that wasn't the case.
Anyway, I've pushed your edit and it will be included in the next release.
Hey man, no need to apologize. Thank you for creating Tempo, and for actively working on it :) .
Looking forward to the next release!
Describe the bug
"Now Playing" scobbles are only sent out when the
onIsPlayingChanged
method is called. So they are only sent out when the first song in a queue of songs is selected to play, and then when the last song is finished playing (that is, if you don't pause and unpause between those two conditions).Expected behavior
"Now Playing" should be sent out for each song that starts playing.
To Reproduce
Environment
Additional context
Thank you so much for merging PR #155 in a such a timely manner. When you refactored my code I thought that it would have the same functionality but be better optimized for the app and also follow your conventions. However, I had chosen to put
MediaManager.scrobble(player.currentMediaItem, false)
inside of theonTracksChanged
method precisely so that it would get called whenever a new song started playing (first song in the queue and all subsequent songs). I also thought of putting it inside ofonIsPlayingChanged
as you did, but doing so this causes this bug. If calling the scrobble from inside ofonTracksChanged
is incorrect, we need to come up with an alternative, perhaps scrobbling inside of both methods?