Page 1 of 1
artist_alphabetical is always same as artist (and other)
Posted: Fri Feb 18, 2005 12:50 am
by Superlexx
in update.php, about line 392:
Code: Select all
$temp = explode(', ', $artist_alphabetic);
should be
Code: Select all
$temp = split('[, ]', $artist_alphabetic);
, because explode will only split the string on exact ', ' match and not on any of the contained characters.
it would also be better to do instead of
Code: Select all
if (in_array ($temp[1], array('The', 'De', 'Het', 'Van', 'Le', 'Les', 'Die')))
the following:
Code: Select all
if (in_array (strtolower($temp[1]), array('a', 'the', 'de', 'het', 'van', 'le', 'les', 'die')))
Also, a feature request: set the album year to the year of the most tracks in it if it's not already set (or to the year of the first track for simplicity).
CU
Posted: Fri Feb 18, 2005 1:44 am
by Superlexx
hm, I'm afraid I've misunderstood the purpose of artist_alphabetical and artist
.
What I expected from it was to allow sorting like WMP9/10 does, but it seems that it's for converting "Cure, The" to "The Cure", my folder names are all like "The Cure" anyway
.
So I modified the code to allow WMP-like sorting
and, there's a typo in browse.php, just search for "Arist"
Posted: Fri Feb 18, 2005 1:14 pm
by wbartels
Code: Select all
if (in_array (strtolower($temp[1]), array('a', 'the', 'de', 'het', 'van', 'le', 'les', 'die')))
That is a good tip to lowercase first.
I will use it on the next version.
Superlexx wrote:So I modified the code to allow WMP-like sorting
Can you give me an example how WMP sorts?
Posted: Fri Feb 18, 2005 6:09 pm
by Superlexx
wbartels wrote:Can you give me an example how WMP sorts?
it sorts like
Code: Select all
Anathema
The Beatles
Caliban
The Doors
Eminem
A Perfect Circle
Tool
and the modified PHP code in update.php is:
Code: Select all
$temp = explode(' ', $artist);
@array_walk($temp, 'trim'); // removes traling and leading white spaces
if ( count($temp) >= 2 && in_array (strtolower($temp[0]), array('a', 'the', 'de', 'het', 'van', 'le', 'les', 'die')) )
{
$article = array_shift($temp);
$artist_alphabetic = strtolower(implode(" ", $temp) . ", $article");
}
else
$artist_alphabetic = strtolower($artist);
$artist_alphabetic = str_replace('ä', 'ae', $artist_alphabetic);
$artist_alphabetic = str_replace('ö', 'oe', $artist_alphabetic);
$artist_alphabetic = str_replace('ü', 'ue', $artist_alphabetic);
$artist_alphabetic = str_replace('ß', 'ss', $artist_alphabetic);
also code in other files like browse.php needs to be modified to output $artist istead of $artist_alphabetic
Posted: Sat Feb 19, 2005 1:50 pm
by wbartels
Sorry, but I don't like the WMA sorting order.
I have done something similar with two columns for artist.
Than it will look like this:
Code: Select all
Anathema
The Beatles
Caliban
The Doors
Eminem
A Perfect Circle
Tool