Deleting multiple tracks from Auto DJ (any playlist) is buggy

Bug #669043 reported by Mikko Jania
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
Mikko Jania
1.8
Fix Released
Medium
Mikko Jania

Bug Description

If the user has e.g. 4 songs (A, B, C, D) in the Auto DJ and decides to delete them all from the list, the method will only delete A and C.

The problem seems to lie in the method PlaylistTableModel::removeTracks(const QModelIndexList& indices).

The methods puts the indices of the tracks that should be deleted into a list and iterates forward through them. So we have the following indices (1, 2, 3, 4). So in the first iteration the methods deletes the track at index 1, which is A. This removes A from the playlist and moves B to the first position, C to the second and D to the third. Now the method deletes the track at index 2, which is now song C.

I suggest sorting the indexes (in case they are not orderd ascending, maybe because of sorting by clicking a table header) and then deleting the tracks in reverse.

I have attached a patch, that does that.

Related branches

Revision history for this message
Mikko Jania (mikko-jania) wrote :
description: updated
Revision history for this message
Theresa Forster (theresajayne) wrote :

This is more indepth
load track 01-20 into autodj
Select TRack05 - 08 (4 tracks selected)
Select Remove

Deletes Track05 07 09 11
not 05 06 07 08

my guess would be that the counter is being double incremented in the loop

ie for(a=start;a<start+count;a++) {
   do something
  a++;
}

Revision history for this message
Theresa Forster (theresajayne) wrote :

the opening problem

4 records in the autodj
select all
deletes 1 3 and tries 5 7

Revision history for this message
Theresa Forster (theresajayne) wrote :

hmm the opener also has a point you need to delete from top down otherwise the index count changes.

Damn i need to practice more with C++

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Committed Mikko's patch to 1.8 and trunk. Thanks Mikko!

Changed in mixxx:
status: New → Confirmed
status: Confirmed → Fix Committed
importance: Undecided → Medium
assignee: nobody → Mikko Jania (mikko-jania)
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5620

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.