Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic error in numerical sorting of album names
11-01-2014, 16:51
Post: #1
Basic error in numerical sorting of album names
I have just installed MinimServer on my Synology DS412+ and in general I am very impressed with its capabilities, however the sorting of album names including numbers from a MinimServer library scan has a fundamental error in the algorithm used.
MinimServer read my iTunes library and found no errors. For classical music I use the 'album' field for the title of the work. In iTunes my recordings of Bach cantatas are listed:
………….
Bach - Cantata No.199
Bach - Cantata No.200
Bach - Cantata No.201
………...
etc etc
In MinimServer the Bach cantatas are listed:
………….
Bach - Cantata No.199
Bach - Cantata No.2
Bach - Cantata No.200
Bach - Cantata No.201
………...
etc etc
Obviously the sorting in MinimServer is being done purely on character 'value'. This will be incorrect for numbers. If a number is encountered the next character should be read and a numerical value accumulated by multiplying the previous integer by 10 and adding this to the current integer value. This should be repeated until a non-numeric character is reached. Sorting should then be done using the accumulated number.

Any likelihood that this error can be corrected?

David

System: ALAC iTunes library on Synology DS412+ (running MinimServer) > Airport Extreme bridge > Optical isolation > dCS Network Bridge (controlled by Galaxy Tab S2 tablet running BubbleUPnP&Mosaic) > PS Audio DirectStream DAC > Primare A60 > Harbeth SHL5plus 40th Anniversary model
Find all posts by this user
Quote this message in a reply
11-01-2014, 17:31
Post: #2
RE: Basic error in numerical sorting of album names
(11-01-2014 16:51)DavidL Wrote:  I have just installed MinimServer on my Synology DS412+ and in general I am very impressed with its capabilities, however the sorting of album names including numbers from a MinimServer library scan has a fundamental error in the algorithm used.

This is not an error. The default sort uses an alphabetical collating sequence. If you need custom sorting of album names, you can use the ALBUMSORT tag to do this.
Find all posts by this user
Quote this message in a reply
11-01-2014, 18:57
Post: #3
RE: Basic error in numerical sorting of album names
(11-01-2014 17:31)simoncn Wrote:  This is not an error. The default sort uses an alphabetical collating sequence. If you need custom sorting of album names, you can use the ALBUMSORT tag to do this.

I have just read your post #5 on this subject here:
http://forum1613.minimserver.com/showthr...=albumsort

I'm new to MinimServer so I'd appreciate some further guidance. Running MinimServer on a NAS how do I go about setting up the necessary tag modification / definition ascii file on the NAS (presumably)? The process described at post #5 above looks both complex and very time-consuming to implement as I have ~60000 tracks, 76% of which are classical music. I'd really like a way to transfer the successful use of tags by iTunes to get the correct sorting to the MinimServer library scan.

Thanks in advance for any help.

David

System: ALAC iTunes library on Synology DS412+ (running MinimServer) > Airport Extreme bridge > Optical isolation > dCS Network Bridge (controlled by Galaxy Tab S2 tablet running BubbleUPnP&Mosaic) > PS Audio DirectStream DAC > Primare A60 > Harbeth SHL5plus 40th Anniversary model
Find all posts by this user
Quote this message in a reply
11-01-2014, 19:07 (This post was last modified: 11-01-2014 19:10 by simoncn.)
Post: #4
RE: Basic error in numerical sorting of album names
(11-01-2014 18:57)DavidL Wrote:  I have just read your post #5 on this subject here:
http://forum1613.minimserver.com/showthr...=albumsort

I'm new to MinimServer so I'd appreciate some further guidance. Running MinimServer on a NAS how do I go about setting up the necessary tag modification / definition ascii file on the NAS (presumably)? The process described at post #5 above looks both complex and very time-consuming to implement as I have ~60000 tracks, 76% of which are classical music. I'd really like a way to transfer the successful use of tags by iTunes to get the correct sorting to the MinimServer library scan.

Thanks in advance for any help.

David

If you are transferring a custom-sorted library from iTunes, the files might already have the necessary ALBUMSORT tags in place. If this is the case, you would need only to follow the instructions in the post that you referenced (with the exception of step 3).
Find all posts by this user
Quote this message in a reply
11-01-2014, 22:26
Post: #5
RE: Basic error in numerical sorting of album names
[/quote]

If you are transferring a custom-sorted library from iTunes, the files might already have the necessary ALBUMSORT tags in place. If this is the case, you would need only to follow the instructions in the post that you referenced (with the exception of step 3).
[/quote]

Thanks for the help.

Before following your advice I investigated further and discovered that file structure on my Synology NAS mirrored exactly the 'errors' I described in my first post, whereas the file structure of the original library on a Mac that I'd copied to the NAS was 'correct'. Weirder still playing back the library on the NAS via iTunes I got the correct ordering of albums. Thus the iTunes player sorts out the correct order of albums.

I'm now wondering whether the file sorting on the NAS is the source of my problems so I've posted accordingly on the relevant Synology forum.

David

System: ALAC iTunes library on Synology DS412+ (running MinimServer) > Airport Extreme bridge > Optical isolation > dCS Network Bridge (controlled by Galaxy Tab S2 tablet running BubbleUPnP&Mosaic) > PS Audio DirectStream DAC > Primare A60 > Harbeth SHL5plus 40th Anniversary model
Find all posts by this user
Quote this message in a reply
12-01-2014, 03:36
Post: #6
RE: Basic error in numerical sorting of album names
(11-01-2014 17:31)simoncn Wrote:  
(11-01-2014 16:51)DavidL Wrote:  I have just installed MinimServer on my Synology DS412+ and in general I am very impressed with its capabilities, however the sorting of album names including numbers from a MinimServer library scan has a fundamental error in the algorithm used.

This is not an error. The default sort uses an alphabetical collating sequence. If you need custom sorting of album names, you can use the ALBUMSORT tag to do this.

I tend to sympathize with DavidL here, and I think the sort could sometimes be done in a more "natural" way.

As a first example, if on Windows you create the following four files:
t-1.txt
t-10.txt
t-20.txt
t-2.txt
you will see that they are displayed in that following order in Explorer "detail" view :
t-1.txt
t-2.txt
t-10.txt
t-20.txt
So Windows routinely sort "numbers" in a natural ascending order inside file names. On Linux, one can try this :
% touch t-1.txt t-10.txt t-20.txt t-2.txt
% ls -v t-*.txt
% t-1.txt t-2.txt t-10.txt t-20.txt
On Linux, the '-v' switch can be set to sort numbers in a "natural" ascending order inside file names.

My point is that it is possible to achieve a more pleasing sort sequence of strings which embed numbers by using a more refined sorting algorithm instead of following a strictly aplhabetic collating sequence. The algorithms are there in the OS's, as shown above. I personnaly cannot see any advantage to sticking to pure alphabetic sorting, and why one would not prefer to see by default "t-1 t-2 t-10 t-20" instead of "t-1 t-10 t-2 t-20". Pure alphabetic sorting just does not look and feel right when strings embed numbers. I agree that the use of "...SORT" tags can solve these sorting issues, but this can amount to double the work involved in tagging the album titles, and maintaining the integrity of those titles following a change. Those "...SORT" tags can be really usefull to solve complex sorting issues, but in my humble opinion, they are a bit an overkill for the problem at hand, when refining the sorting algorithm could more cleanly achieve the same result.

Regards
Find all posts by this user
Quote this message in a reply
12-01-2014, 07:34
Post: #7
RE: Basic error in numerical sorting of album names
Is there a way to customize the sort order for tags other than the Album title? I have a Composition tag for each of my classical music files. I use padding zeros with, for instance, Haydn symphonies: Symphony No. 005, 080, 102, etc. since otherwise they are sorted incorrectly. But it would be nicer not to see those leading zeros in the control point.
Find all posts by this user
Quote this message in a reply
12-01-2014, 09:24
Post: #8
RE: Basic error in numerical sorting of album names
(12-01-2014 03:36)Andre Gosselin Wrote:  I tend to sympathize with DavidL here, and I think the sort could sometimes be done in a more "natural" way.

As a first example, if on Windows you create the following four files:
t-1.txt
t-10.txt
t-20.txt
t-2.txt
you will see that they are displayed in that following order in Explorer "detail" view :
t-1.txt
t-2.txt
t-10.txt
t-20.txt
So Windows routinely sort "numbers" in a natural ascending order inside file names. On Linux, one can try this :
% touch t-1.txt t-10.txt t-20.txt t-2.txt
% ls -v t-*.txt
% t-1.txt t-2.txt t-10.txt t-20.txt
On Linux, the '-v' switch can be set to sort numbers in a "natural" ascending order inside file names.

I find the Windows Explorer sort order very strange and not at all natural. Until this post, I found it completely inexplicable why the folder 0.8u1 is sorted before 0.20a. Thanks for explaining that this is intended to be a "feature" rather than a bug as I had assumed.

I wasn't aware of the -v option in Linux. It is described on this page. From this description, it seems rather complex and has some aspects that may not seem natural.

It seems clear from the discussion so far that what is natural to some people is unnatural to others. For this reason, I don't intend to change the default sort order, which is very clear and simple as well as being efficient. (With a large library, good sorting performance is important to ensure user responsiveness.)

I will do some experiments to see how iTunes handles this.
Find all posts by this user
Quote this message in a reply
12-01-2014, 09:29
Post: #9
RE: Basic error in numerical sorting of album names
(12-01-2014 07:34)magister Wrote:  Is there a way to customize the sort order for tags other than the Album title? I have a Composition tag for each of my classical music files. I use padding zeros with, for instance, Haydn symphonies: Symphony No. 005, 080, 102, etc. since otherwise they are sorted incorrectly. But it would be nicer not to see those leading zeros in the control point.

At present, only the album list sort order can be customized (except for the 'ignoreThe' option, which can be applied to all lists). In a future release, I am hoping to provide additional options for customizing the sorting of other lists.
Find all posts by this user
Quote this message in a reply
12-01-2014, 12:26
Post: #10
RE: Basic error in numerical sorting of album names
(12-01-2014 09:24)simoncn Wrote:  
(12-01-2014 03:36)Andre Gosselin Wrote:  I tend to sympathize with DavidL here, and I think the sort could sometimes be done in a more "natural" way.

As a first example, if on Windows you create the following four files:
t-1.txt
t-10.txt
t-20.txt
t-2.txt
you will see that they are displayed in that following order in Explorer "detail" view :
t-1.txt
t-2.txt
t-10.txt
t-20.txt
So Windows routinely sort "numbers" in a natural ascending order inside file names. On Linux, one can try this :
% touch t-1.txt t-10.txt t-20.txt t-2.txt
% ls -v t-*.txt
% t-1.txt t-2.txt t-10.txt t-20.txt
On Linux, the '-v' switch can be set to sort numbers in a "natural" ascending order inside file names.

I find the Windows Explorer sort order very strange and not at all natural. Until this post, I found it completely inexplicable why the folder 0.8u1 is sorted before 0.20a. Thanks for explaining that this is intended to be a "feature" rather than a bug as I had assumed.

…………………………….
It seems clear from the discussion so far that what is natural to some people is unnatural to others. For this reason, I don't intend to change the default sort order, which is very clear and simple as well as being efficient. (With a large library, good sorting performance is important to ensure user responsiveness.)

I will do some experiments to see how iTunes handles this.

OK I can see the two points of view but it was my understanding that MinimServer was designed to cater well for libraries of classical music. I would strongly support the idea of adding an option for sorting albums to allow what you regard as 'unnatural' sorting via embedded numbers. I'm surprised that getting Mozart piano concertos, piano sonatas & symphonies, Haydn piano sonatas, string quartets & symphonies, Bach cantatas, Scarlatti sonatas etc etc to display in the correct order is regarded as 'unnatural'.

System: ALAC iTunes library on Synology DS412+ (running MinimServer) > Airport Extreme bridge > Optical isolation > dCS Network Bridge (controlled by Galaxy Tab S2 tablet running BubbleUPnP&Mosaic) > PS Audio DirectStream DAC > Primare A60 > Harbeth SHL5plus 40th Anniversary model
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)