Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4093 closed defect (fixed)

Shuffle shouldn't sort "All My Music"

Reported by: Paul Lambert <paul at planar.id.au> Owned by: paulh
Priority: minor Milestone: 0.21
Component: mythmusic Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

If you select to show the full music tree in the main window, and select a shuffle mode, the "All My Music" tree gets sorted. It would be tidier if it didn't.

I've looked through the code, and cannot easily see where this occurs. My theory is that these nodes have attributes 0->4 on them the same as any other node, and that the generic tree sorts both leaf nodes and branch nodes.

I can think of three ways to fix this:

  1. Modify the code that creates the branch nodes so that attributes 0-4 are set with numbers rather than whatever they normally are filled with. If set correctly, that would result in the sort order becoming static for this tree. This seems a bit kludgy, but is perhaps easier. I can't obviously see where these branch nodes are created, I've had a bit of a look around. I don't have a visual debugger, and haven't quite reduced myself to putting debug statements in the code to work it out.
  1. Modify the generic tree so that it only sorts leaf nodes. I cannot think of any good reason why we would want to sort nodes other than leaf nodes, but I'm not entirely sure where else in myth the generic tree is used (being named "generic" suggests it might be used elsewhere).
  1. Modify the sorting algorithms or the nodes so that they are aware whether they are sortable or not. Those that are sortable get sorted, those that aren't sortable don't. This is similar to 1., but is doing it properly (at least to my mind). Problem is that I'm not comfortable enough with the code to make the wholesale changes this would probably require.

Any advice or pointers would be appreciated - I am happy to undertake some coding but don't want to break things that I am not aware of.

Change History (3)

comment:1 Changed 12 years ago by paulh

Milestone: unknown0.21
Owner: changed from Isaac Richards to paulh

comment:2 Changed 12 years ago by paulh

Resolution: fixed
Status: newclosed

(In [14759]) If you have 'Show entire music tree' turned on in MythMusic don't shuffle the entire 'All My Music' branch just shuffle the tracks.

Fixes #4093.

comment:3 Changed 12 years ago by Paul Lambert <paul at planar.id.au>

Very nice work paulh!! And quick too.

Note: See TracTickets for help on using tickets.