Bug 14474 - Music Folder browsing ignores non-alphanumeric characters in it's sorting algorithm
: Music Folder browsing ignores non-alphanumeric characters in it's sorting alg...
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Player UI
: 7.4.1
: PC Windows 7
: P1 normal with 1 vote (vote)
: 7.5.0
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-01 06:40 UTC by Chris Tashjian
Modified: 2010-04-08 17:25 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Tashjian 2009-10-01 06:40:19 UTC
The sorting algorithm when browsing the music folder ignores non-alphanumeric characters.  This makes it very difficult for one to manually manage it via the file system on the server...

I have folders in my music folder named:
__FLAC
  __<Artist Name starting with Letter A>
  __<Artist Name starting with Letter Z>
  <Artist Name starting with Letter M>
  <Artist Name starting with Letter O>
__MP3
  __<Artist Name starting with Letter A>
  __<Artist Name starting with Letter B>
  __<Artist Name starting with Letter F>
  <Artist Name starting with Letter C>
  <Artist Name starting with Letter G>
__VIDEO
Random Album #1
Random Album #2

That's the sort order I'd expect to see them in on both my players and the web interface, but it's not... What I end up with is:

__FLAC
  __<Artist Name starting with Letter A>
  <Artist Name starting with Letter M>
  <Artist Name starting with Letter O>
  __<Artist Name starting with Letter Z>
__MP3
  __<Artist Name starting with Letter A>
  __<Artist Name starting with Letter B>
  <Artist Name starting with Letter C>
  __<Artist Name starting with Letter F>
  <Artist Name starting with Letter G>
Random Album #1
Random Album #2
__VIDEO


Wouldn't it make more sense to match the file systems sorting order since when we use "Browse Music Folder" we're ignoring all ID3 tags and just looking at the files as if they were on the computer?  This is a big deal for me because not all of my music is tagged properly, if it was I'd be using the Artist/Album/Song browsing on my players.
Comment 1 James Richardson 2009-10-08 13:40:47 UTC

*** This bug has been marked as a duplicate of bug 14503 ***
Comment 2 Michael Herger 2009-10-12 10:48:31 UTC
Not a dupe... different issue.
Comment 3 James Richardson 2009-10-12 12:57:51 UTC
Michael: is this one yours or Andy's to look at?  please re-target if needed.
Comment 4 Michael Herger 2009-10-13 03:27:01 UTC
We should review this. The sorting function is only used for BMF. Thus it should be relatively safe to change the behaviour. Obviously this sorting has caused some discussion before. From the code:

	# File sorting should look like ls -l, Windows Explorer, or Finder -
	# really, we shouldn't be doing any of this, but we'll ignore
	# punctuation, and fold the case. DON'T strip articles.

I'll second this.
Comment 5 Jim McAtee 2009-10-19 16:02:14 UTC
(In reply to comment #4)
>     # File sorting should look like ls -l, Windows Explorer, or Finder -
>     # really, we shouldn't be doing any of this, but we'll ignore
>     # punctuation, and fold the case. DON'T strip articles.
> 

It also shouldn't fold the case.  On case-sensitive OS's you want two folders with the same spelling but differing case to be distinct.  It essentially looks like the folders have merged if you fold the case.  On OSs that are case-sensitive it won't matter, since you can't have two directories or filenames with the same spelling and different case.

When you do the readDirectory() for BMF, doesn't every OS offer a sorting facility so that you don't have to do it yourself in SbS?
Comment 6 SVN Bot 2009-10-20 01:35:44 UTC
 == Auto-comment from SVN commit #28943 to the slim repo by michael ==
 == https://svn.slimdevices.com/slim?view=revision&revision=28943 ==

Fixed Bug: 14474 +1
Description: don't strip out non alphanumerical characters before sorting directory content. Sort by lower case value to make a few more characters show up before the actual list.
Comment 7 SVN Bot 2009-10-20 01:52:06 UTC
 == Auto-comment from SVN commit #28944 to the slim repo by michael ==
 == https://svn.slimdevices.com/slim?view=revision&revision=28944 ==

Bug: 14474
Description: don't use ignorePunct to display the indes character in SP
Comment 8 Jim McAtee 2009-10-20 10:44:26 UTC
Safe change.  Should be made to 7.4.1.
Comment 9 Jim McAtee 2009-10-20 10:49:01 UTC
Wait a minute... What's the reason for continuing to fold the case?  Changing uc() to lc() just gives you a different sort order.
Comment 10 Chris Owens 2010-04-08 17:25:28 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!