After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 563021 - Play count not updated when "stop after current song" is enabled
Play count not updated when "stop after current song" is enabled
Status: VERIFIED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: 1.x
Assigned To: Alexander Kojevnikov
Banshee Maintainers
: 586101 600612 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-12-02 20:02 UTC by Wouter Bolsterlee (uws)
Modified: 2009-11-11 13:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Call IncrementLastPlayed() when the playback is stopped (684 bytes, patch)
2009-10-08 10:19 UTC, Alexander Kojevnikov
committed Details | Review
Advance the current track if StopWhenFinished is on (1.16 KB, patch)
2009-11-02 05:00 UTC, Alexander Kojevnikov
committed Details | Review

Description Wouter Bolsterlee (uws) 2008-12-02 20:02:24 UTC
The summary says it all.
Comment 1 Wouter Bolsterlee (uws) 2008-12-02 20:03:53 UTC
Hmm, and now I can't reproduce. Could it be that this was not committed to the database, since I quit banshee right after the song finished playing...

(Anyway, it should also update the play count if I quit after half of the song has been played—at least that's how it works for skipping afaics.)
Comment 2 Michael Martin-Smucker 2008-12-26 14:02:12 UTC
I see this and can confirm with 1.4.1.  It seems that the play count is updated when the next song begins rather than when the song finishes.  This is also the case for the last song in the play queue.  When the last song finishes, if Banshee doesn't start playing from some other source, that song's playcount doesn't increase.
Comment 3 Benjamín Valero Espinosa 2009-03-11 16:28:24 UTC
Confirmed with trunk version.
Comment 4 Gabriel Burt 2009-03-11 16:30:00 UTC
Benjamin, do you not have bug editing privs?  If not, go to http://live.gnome.org/Bugsquad and get them.
Comment 5 Alexander Kojevnikov 2009-10-08 10:15:09 UTC
*** Bug 586101 has been marked as a duplicate of this bug. ***
Comment 6 Alexander Kojevnikov 2009-10-08 10:19:44 UTC
Created attachment 145027 [details] [review]
Call IncrementLastPlayed() when the playback is stopped

The patch fixes both this bug and the duplicate. Please test.
Comment 7 Michael Martin-Smucker 2009-10-15 16:49:43 UTC
I tested this with the three scenarios that came up in this report and the duplicate:

1. Stop after song
2. End of the Play Queue (with manually added songs, when Banshee doesn't continue to another source)
3. End of a smart playlist of songs with 0 plays

All of these scenarios work flawlessly with this patch, and I haven't seen any negative side effects.
Comment 8 Alexander Kojevnikov 2009-10-16 00:02:13 UTC
Committed, thanks for testing!
Comment 9 Michael Martin-Smucker 2009-11-02 03:15:39 UTC
@Alexander: One more thing - and I realize that this is a bit of a separate issue, so I'll gladly file a separate report if you don't have a magical one-line fix up your sleeve - but a variation of this issue still exists with the play queue. 

If you're listening to the queue, and you tell it to "stop after song," the play count is now updated as expected, but the queue doesn't treat the song as if it were played.  For example, you listen to a song in the queue, it stops after that song; you then listen to a second song, not in the queue, after the second song finishes, it jumps back to the play queue and plays the song that you already listened to a second time.

If this takes any significant amount of work to fix, let me know and I'll file a separate bug for it.
Comment 10 Alexander Kojevnikov 2009-11-02 05:00:56 UTC
Created attachment 146718 [details] [review]
Advance the current track if StopWhenFinished is on

Thanks Michael, this patch should fix it.
Comment 11 Michael Martin-Smucker 2009-11-03 22:03:38 UTC
*** Bug 600612 has been marked as a duplicate of this bug. ***
Comment 12 Michael Martin-Smucker 2009-11-06 15:12:52 UTC
Alexander, thanks for the patch!  Your patch fixes the issue as I described it, but the bug that I closed as a duplicate of this report is not quite fixed with the patch.  Specifically:

Let's say I'm listening to the play queue.  I choose "stop after song" and walk away from my computer.  If I come back to my computer awhile later and hit play, the same song will play again, because even though it is "grayed out" and marked as played, it is still selected.

It would be nice if when the "stop after..." song finishes, it would be moved up a slot, auto-dj (if on) would add another song to the queue, and selection would move to the next song.  This should avoid playing the same song twice in a row with "stop after song" enabled.
Comment 13 Alexander Kojevnikov 2009-11-11 06:13:09 UTC
Michael, I committed the previous patch, thanks for testing it!

The issue you described applies to all sources, that's how the StopWhenFinished currently works: it stops playback without querying for the next track to play and changing the selection.

I'm not sure what the correct behaviour should be. For example if I'm in the music library and the shuffle is on, advancing to the next track means I won't know which song played last when I selected the "stop after..." option.

Anyway, I'm closing the bug because I think the play queue is now on par with the rest of the app in how it handles the "stop after..." option. Feel free to open a new bug if you think the option's behaviour should be changed, whether globally or only in the play queue.
Comment 14 Michael Martin-Smucker 2009-11-11 13:48:15 UTC
Fair enough, and thanks for writing/committing the patch.  I opened bug 601538 to address the remaining issue.  I'm also not really sure what the best fix is.