Bug 139829

Summary: Sorting artist in playlist does not exclude leading "The" as the collection browser does.
Product: [Applications] amarok Reporter: Rick Wagner <rjwgnr27>
Component: Playlists/Saved PlaylistsAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 1.4-SVN   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

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: