Albums added from albumview to queue are always shuffled

Bug #1061412 reported by Kurt Smolderen on 2012-10-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BeatBox
Medium
Kurt Smolderen

Bug Description

When you add an album to the queue from the album view, songs are shuffled regardless of the shuffle settings. Adding an album form list view works as expected.

Using Beatbox version 0.6 r775 from PPA

Related branches

Scott Ringwelski (sgringwe) wrote :

Hey Kurt, nice catch. Would you be interested in taking on this bug?

Changed in beat-box:
status: New → Triaged
importance: Undecided → Medium
Kurt Smolderen (kurt.smolderen) wrote :

Hey Scott, no problem to have a look at it, as long as it doesn't need to be fixed this week :-). I will have more time to work on it after the next weekend.
If that's not a problem, feel free to assign the bug to me.

Scott Ringwelski (sgringwe) wrote :

Sounds great!

Changed in beat-box:
assignee: nobody → Kurt Smolderen (kurt.smolderen)
milestone: none → 0.7
Changed in beat-box:
milestone: 0.7 → none
Kurt Smolderen (kurt.smolderen) wrote :

Sorry for not getting into this any sooner...

The cause of this behaviour has been found, but I need some thoughts on the appropriate fix.

Problem is the songs in a BeatBox.Album object are stored in a hashmap with the media is key and an integer as value => What's the purpose of this integer?

When dragging an album to the queue, the keys of the hashmap (the Media objects) are converted into a Collection with no particular order...

The same problem (displaying tracks in what seems to be a random order) would rise when the album info popup is shown, but for this window, the media files are explicitly reordered (FastList.reorder).

Most elegant solution IMHO is to adjust the Album class so that its media files are stored in an ordered way: first by track number, then by track title.

Any feedback is welcomed!

Kurt Smolderen (kurt.smolderen) wrote :

If we replace the HashMap in BeatBox.Album with a TreeMap, we can register a sort_function for the keys...

Proposed sort order:
1) Media.track (Album contains songs)
2) Media.date_released (Album contains podcasts => or is this not possible?)
3) Media.title (fallback when previous information is not available)

Scott Ringwelski (sgringwe) wrote :

The advantage of the hashmap is that we can check if an album contains a given song in constant time, which is extremely preferred in other places.

I would just sort it when the user starts the drag.

Changed in beat-box:
status: Triaged → In Progress
Changed in beat-box:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers