Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Last song in Queue is counted twice #217

Closed
internetfreak opened this issue Feb 2, 2022 · 1 comment
Closed

Last song in Queue is counted twice #217

internetfreak opened this issue Feb 2, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@internetfreak
Copy link

This is a follow-up to my issue at #187 which I've tested by now via the latest release

Describe the bug
When playback ends at the end of a song queue, jellyfin counts the playback for that song twice even though playback has stopped. This can be seen via dashboard and either within the Playback Reporting or the native jellyfin reporting

To Reproduce
Steps to reproduce the behavior:

  1. Using v0.12.0 add some songs to the queue (I haven't tested if if also occurs with one song, but with 2+ songs it will occur)
  2. Having scrobbling active, play them and wait for the last song to have finished playing
  3. After the queue ends, watch the dashboard. You will see that the last played song seems to be running again. Verify that both reporting methods show the last song being played twice without having repeat active

Expected behavior
When playback stops, the status sent to jellyfin should also reflect that nothing is played anymore

Screenshots
Here's a screenshot of the native reporting. Notice that the song immediately is considered to be playing again, but playback only stops after 6 minutes (the song is 3:44 min long)
image

Here's the view from within the Playback Reporting Plugin (the same from my other issue). Notice that the playtime is also off compared to the real song (the one hour difference in time is from timezones, seems that the native reporting is using UTC, while I am in UTC+1 and it's currently 7:32am here)
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: 0.12.0

Additional context
I have noticed that the status reported to jellyfin seem to lag a bit behind the status seen in sonixd. One song wasn't even reported properly, I toggled scrobbling and then it somehow worked again. While I am not really good enough to do something in code, I'll gladly provide any info you need and I can test stuff before release

@internetfreak internetfreak added the bug Something isn't working label Feb 2, 2022
jeffvli added a commit that referenced this issue Feb 2, 2022
- Set condition to only scrobble when player status is PLAYING
- Fix Jellyfin player position on play and pause
@jeffvli jeffvli self-assigned this Feb 2, 2022
@jeffvli jeffvli added this to the Release (0.12.1) milestone Feb 2, 2022
@jeffvli
Copy link
Owner

jeffvli commented Feb 2, 2022

Thanks for reporting in such detail :)

I made some additional changes to the player which should resolve the following:

  • No longer sends another play request to the server after the last song ends. This was occurring because I didn't add a check to make sure to only send it if the player has the status of "PLAYING". You see that playback continues for 6 minutes because there's no "STOP" being sent to the "ghost" player.
  • The player time (on the dashboard) shouldn't lag behind as much anymore. Since there's now a 5 second timeout after the song starts before the play request is sent, it was sending a position of 0, which has now been changed to 5 to match the time properly. It may still be off +-1 second but that's normal.
  • Player should now also properly handle pause/resume. When I was making changes to the scrobbling, I seem to have removed and forgot to re-add some logic when the player pauses and resumes. That meant that once the player was paused during playback, resuming would not resume it on Jellyfin since it was stuck until the next song.

Going to push a hotfix release with these changes shortly.

One song wasn't even reported properly

Let me know if after these changes this still occurs or if there are any other issues.

@jeffvli jeffvli closed this as completed Feb 2, 2022
Repository owner moved this from Todo to Done in Sonixd (Roadmap and Releases) Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants