Bug 4309 - Sort genres by name in Random Mix
: Sort genres by name in Random Mix
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 7.0
: PC Windows XP
: P2 enhancement (vote)
: ---
Assigned To: KDF
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-05 18:33 UTC by Jim McAtee
Modified: 2008-12-18 11:11 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
allow sort by genre name (1.56 KB, patch)
2006-10-05 20:20 UTC, KDF
Details | Diff
handle lists. (4.71 KB, patch)
2006-10-05 23:08 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jim McAtee 2006-10-05 18:33:06 UTC
Ideally sorted within the two columns, but that's less important than just getting them into an order that makes finding things easier.
Comment 1 KDF 2006-10-05 20:20:30 UTC
Created attachment 1623 [details]
allow sort by genre name

ok, couple of items that make this work.  First, %genres is now keyed by name. This is all that is needed, but there are added benefits aside from sorting.  We save the disabled genres by name, which means they can persist across scans. the current method stores id's that can change.  Also, the name keys mean that the param matching needed to change a bit.  Iterating through the %genres hash means less iterations than currently where we are iterating through the entire params hash. yikers.
Comment 2 Jim McAtee 2006-10-05 20:42:54 UTC
Kevin, that's perfect.  Except that I'm getting inverted checkbox behavior.  If I 'Select All' and then Save, when the page is reloaded, no checks appear.  If I check only 'Blues' and 'Rock', then when the page reloads after a Save, everything except those two are checked off.
Comment 3 Jim McAtee 2006-10-05 21:35:39 UTC
Actually, the patch breaks things pretty good.  I just noticed that nothing is added to the playlist when doing a Play or Add Random songs, artists, or albums.  Random years crashes:

Can't call method "year" on an undefined value at C:\Program Files\SlimServer\server/Plugins/RandomPlay/Plugin.pm line 207.
Comment 4 KDF 2006-10-05 21:53:30 UTC
seems I got caught on my own caching.  simple inversion there, but I need to check out the filtering before another rev.
Comment 5 KDF 2006-10-05 22:12:56 UTC
no worries, testing and tackling a list as we speek
Comment 6 KDF 2006-10-05 23:08:30 UTC
Created attachment 1624 [details]
handle lists.

ok, this fixes the player genre list, the inverted web form, the checkbox overlay is upgraded to the current style, and fixes a bunch of undef warnings from INPUT.Choice caused by current svn.

the years crash is probably due to the filterGenres function being mixed up after swapping name/id.  it now seems to be fine.
Comment 7 Jim McAtee 2006-10-06 01:45:38 UTC
That looks very good.

Something I'm noticing, maybe unrelated to the patch, is that a change of player in the status pane has no effect within Random Mix.  To duplicate:  Go into Random Mix, change the player, then play Random songs or whatever and it plays to the orginally selected player.
Comment 8 KDF 2006-10-06 09:25:21 UTC
right, I expect the player change script isn't making the right changes to teh random mix page.  After working with it last night, it's clear now that it doesn't really fit in with the way other pages work. easy fix, however.
Comment 9 KDF 2006-10-06 12:55:56 UTC
filed the refresh problem as bug 4317, and it shoudl now be fixed.  

leaving sorting out as this is currently set as an enhancement and i believe things are too close to 6.5.1 release to be worrying about a rework of this type.

of course, the patch is ready should it be desired for 6.5.1.  but that's Chris/Dean/Dan's call.
Comment 10 Jim McAtee 2006-10-06 13:55:33 UTC
Maybe check it in to the trunk?
Comment 11 KDF 2006-10-06 14:05:56 UTC
I'll commit in a few days once 6.5 merges are not an issue, unless this is decided as worthwhiel merging.
Comment 12 Chris Owens 2006-10-09 10:09:26 UTC
Targeting for 7.0
Comment 13 KDF 2006-10-09 23:28:28 UTC
in trunk at change 10273. reopen if problems come up.
Comment 14 KDF 2006-10-17 20:07:58 UTC
merged to 6.5.1 at change 10383