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

Time position at the end of playback is considered to be total time played #16

Open
nouste opened this issue Nov 4, 2015 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@nouste
Copy link

nouste commented Nov 4, 2015

The extension does not count the actual time a track has been played, but only checks the time position at the end of playback to do the math. The problem in this approach is that after a track has started to play and someone jumps past the half duration of the track (or past 240 seconds) and then skips to next track, the track will be scrobbled no matter how long it has been played.

I found this issue when I had a couple of new albums on my playlist which I just quickly skipped through while listening a few seconds here and there from each track. To my surprise I later noticed that all of the tracks had been scrobbled.

@adamcik
Copy link
Member

adamcik commented Nov 15, 2015

Indeed, we would need much better book keeping to get this right. Probably we can do something like the following:

on-track-start:
  last_position = 0
  played_time = 0

on-seek:
  played_time += current_position - last_position
  last_position = seek_position

on-track-change:
  played_time += current_position - last_position
  if played_time > ...:
    scrobble()

@adamcik
Copy link
Member

adamcik commented Nov 15, 2015

We could also consider if this is something that mopidy should / could keep track of instead of leaving it to extensions.

@adamcik
Copy link
Member

adamcik commented Nov 21, 2015

Having looked at this due to other reason, I don't think we have a sane way of getting current_position without changing something in core.

@jodal jodal added the C-bug Category: This is a bug label Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants