Bug 139829 - Sorting artist in playlist does not exclude leading "The" as the collection browser does.
Summary: Sorting artist in playlist does not exclude leading "The" as the collection b...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Saved Playlists (show other bugs)
Version: 1.4-SVN
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-09 20:32 UTC by Rick Wagner
Modified: 2007-01-28 01:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Wagner 2007-01-09 20:32:40 UTC
Version:           1.4-SVN (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

In the playlist viewer, clicking the "Artist" column header to sort on the artist does not ignore leading "The" as the collection browser does.  

In the collection browser, "The Cars" is sorted as "Cars" with all the other "C*" artists.  In the playlist, "The Cars" is sorted together with other "The *" names, way down in the other "T" names.  Ignoring the leading "The" on the playlist sort (at least for artist, maybe album) would be preferred.
Comment 1 Martin Aumueller 2007-01-28 01:35:37 UTC
SVN commit 627760 by aumuell:

ignore 'the' when sorting playlist by artist
BUG: 139829


 M  +1 -0      ChangeLog  
 M  +7 -0      src/playlistitem.cpp  


--- trunk/extragear/multimedia/amarok/ChangeLog #627759:627760
@@ -47,6 +47,7 @@
       you move and rename them.
 
   CHANGES:
+    * Ignore leading 'The ' when sorting playlist by artist. (BR 139829)
     * Smart Playlists now have 'does not start with' and 'does not end with' 
       options, as well as a dropdown for mount points. (BR 139552)
     * Support for cue files not matching audio files' name. Patch by Dawid
--- trunk/extragear/multimedia/amarok/src/playlistitem.cpp #627759:627760
@@ -488,6 +488,13 @@
         case Artist:
             if( a == b ) //if same artist, try to sort by album
                 return compare( i, Album, ascending );
+            else
+            {
+                if( a.startsWith( "the ", false ) )
+                    a = a.mid( 4 );
+                if( b.startsWith( "the ", false ) )
+                    b = b.mid( 4 );
+            }
             break;
 
         case Album: