play count increases even if same track is played

Bug #1000431 reported by Owen Williams on 2012-05-16
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Low
RJ Skerry-Ryan

Bug Description

If a deck is stopped and started multiple times, the play count will be increased every single time the play button is toggled. This could be fixed a few ways:

* don't increase play count unless a track is newly loaded
* keep a "we counted this one" flag, and don't increment the play value if it's already set
* don't increase play count if the current track has the same ID as the last track.

RJ Skerry-Ryan (rryan) wrote :

Yea.. this is from the history's new way of counting plays.

I prefer option 1 .. if the track is already marked played, don't count it again. I think that it still might be fair to add to the history ONLY if it wasn't the immediately previously played track (b/c you might play a track twice during your set) or maybe if it has been unloaded from a deck since it was first counted.

Changed in mixxx:
status: New → Confirmed
importance: Undecided → Low
milestone: none → 1.11.0
Owen Williams (ywwg) wrote :

Ok I'll give that method a shot. I notice this bug most when I'm bpm-ing and tagging tracks and I play them one at a time. I'll skip around and check things and the play count goes up to 6 or 7.

Changed in mixxx:
assignee: nobody → Owen Williams (ywwg)

This is also affected by the cross-fader. If you switch to deck B for like 1 second, then back to A, both tracks get a count increase.

I like method #3, discard the increment if the current track was the last one played on this deck. (To avoid double-counting a track if you're previewing a number of them on this deck and reload the first one you previewed and decide to play it.)

Daniel Schürmann (daschuer) wrote :

This bug depends on Bug #783634.

The original solution had a "m_oldTrackIdPlayer[]" to detect if the track was newly loaded to the deck and to prevent multiple counts while heavy mixing.
http://bazaar.launchpad.net/~daschuer/mixxx/features_setlog/view/head:/mixxx/src/library/setlogfeature.cpp
This was lost on the way to trunk and I have not noticed it until now.

I thing this was most like solution #1 and my favorite.

Inc played-count when a track is newly loaded AND played to the audience.
Inc playcount again if the track is played again later in the evening.

RJ Skerry-Ryan (rryan) wrote :

I added a 6-track window that if the current-playing track is in the window it doesn't get an incremented playcount or addition to the session history. This way if you play a track later on in the night it still gets counted but quickly juggling between tracks doesn't count as an additional play. Sorry for removing this from the setlog branch Daniel -- I didn't like how it used track-ids since those don't work for itunes/rb/traktor but I forgot to add the logic back in!

Changed in mixxx:
status: Confirmed → Fix Committed
assignee: Owen Williams (ywwg) → RJ Ryan (rryan)
Daniel Schürmann (daschuer) wrote :

Hi RJ,

I just wonder why you think comparing the track Ids will not work.
For the setlog feature every track played has to be stored in the mixxx database and must have a track ID.
This should already be the case. If not, it is a different bug.
A Track without a track ID can not be listed in the set log play list.

see:
src/library/rhythmbox/rhythmboxtrackmodel.cpp line 50.

I would prefer to compare the unique track ID, because i am not sure if a pointer compare is valid in all conditions.
Does storing it in a Linked list increment the reference counter of the shared pointer?
Does this introduce a second kind of (not intended) track cache?
We will get a new pointer address if the track falls out of cache and the comparison fails or furthermore can it be false equal?

Kind regards,
Daniel

Changed in mixxx:
status: Fix Committed → In Progress
RJ Skerry-Ryan (rryan) wrote :

Hm, good point. It's very rare that a track will not have an id -- it would have to fail to be added to the library first.

This code has to process tracks that have an id and tracks that don't (because it is now the place in Mixxx that's in charge of marking tracks as played and incrementing their play count. We won't add tracks to the setlog playlist if they don't have an id)

In general, it's always valid to compare pointers because we don't ever have more than one TrackInfoObject for a library track (this list does keep hard-references to the tracks so they won't go out of cache).

Good point about the unintended track cache. When the SetlogFeature is deleted these references will be freed so the tracks will be saved before shutdown, but I agree this isn't ideal.

So to summarize, I think the only downside of using ids instead of TrackPointers is that tracks that don't have an ID will have exhibit the problem this bug describes -- their play count will be incremented every time they become the current-playing-track. This is OK though since we don't really display or record the play-count for tracks that aren't in the database (and you're right that RB/IT/T tracks are indeed Mixxx library tracks after getTrack()). I'll switch us to using IDs instead of TrackPointers.

Thanks for insisting :)
RJ

RJ Skerry-Ryan (rryan) on 2012-05-26
Changed in mixxx:
status: In Progress → Fix Committed
RJ Skerry-Ryan (rryan) on 2013-05-09
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers