Bug 176670 - services don't handle "The X" artists correctly
Summary: services don't handle "The X" artists correctly
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Internet Services (show other bugs)
Version: 2.3-GIT
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: 2.3.0
Assignee: Amarok Developers
URL:
Keywords:
: 177801 191063 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-02 05:40 UTC by Casey Link
Modified: 2010-01-07 11:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Casey Link 2008-12-02 05:40:58 UTC
Version:           SVN (using KDE 4.1.3)
Installed from:    Ubuntu Packages

Services such as Ampache, MP3tunes, and scriptable service like BBC and NPR do not correctly handle artists names that begin with "The"


"The Doobie Brothers" should be up under D not T
Comment 1 Casey Link 2008-12-15 03:14:49 UTC
*** Bug 177801 has been marked as a duplicate of this bug. ***
Comment 2 Myriam Schweingruber 2009-05-15 10:55:56 UTC
*** Bug 191063 has been marked as a duplicate of this bug. ***
Comment 3 Unknown 2009-05-15 12:34:16 UTC
My bug has been marked as duplicate, but I described something different (perhaps it is related implemention-wise): When I drag songs from the collection browser or the file list to the playlist, the sorting is wired and unpredictable. It is even a difference whether I drag a folder to the list or browse into that folder and drag all of the files. And I get a different playlist whether I drag the header of my collection or select all artists and drag them - and neither of the two playlists are sorted by artist, album or whatever.
Comment 4 Myriam Schweingruber 2009-05-15 13:41:22 UTC
(In reply to comment #3)
Well, then you should be a tad more clear in your report, as you are mixing in at least three different things. 
Please, report one item per bug only, else it's getting too complicated.
What about dotted lists? Might be clearer than one single paragraph. Just my 2 cents...
Comment 5 Ralf Jung 2009-05-15 14:48:51 UTC
It's hard to know what is related and what not (so, what should get into a separate report) without knowing the source. Besides, I have no real clue what happens, just that it is strange (so the summary line is basically everything which is sure). I'll try to clarify in the other report.
Comment 6 Myriam Schweingruber 2009-08-02 13:17:31 UTC
Any news on this?
Comment 7 Myriam Schweingruber 2009-11-04 00:23:23 UTC
Any news on this?
Comment 8 Myriam Schweingruber 2009-11-16 13:41:34 UTC
Changing target
Comment 9 Mikko C. 2010-01-07 11:13:47 UTC
commit 24da2657f2f339a09bdc26e8c9a615349bb8f627
Author:     Maximilian Kossick <maximilian.kossick@googlemail.com>
AuthorDate: Fri Dec 25 22:24:56 2009 +0100
Commit:     Maximilian Kossick <maximilian.kossick@googlemail.com>
CommitDate: Thu Jan 7 09:04:05 2010 +0100

    correctly sort artists starting with 'The' in services as well.
    
    BUG: 176670

diff --git a/src/collection/sqlcollection/SqlMeta.cpp b/src/collection/sqlcollection/SqlMeta.cpp
index 768d933..044ef97 100644
--- a/src/collection/sqlcollection/SqlMeta.cpp
+++ b/src/collection/sqlcollection/SqlMeta.cpp
@@ -988,21 +988,6 @@ SqlArtist::albums()
     return AlbumList();
 }
 
-QString
-SqlArtist::sortableName() const
-{
-    if ( m_modifiedName.isEmpty() && !m_name.isEmpty() ) {
-        if ( m_name.startsWith( "the ", Qt::CaseInsensitive ) ) {
-            QString begin = m_name.left( 3 );
-            m_modifiedName = QString( "%1, %2" ).arg( m_name, begin );
-            m_modifiedName = m_modifiedName.mid( 4 );
-        }
-        else
-            m_modifiedName = m_name;
-    }
-    return m_modifiedName;
-}
-
 bool
 SqlArtist::hasCapabilityInterface( Meta::Capability::Type type ) const
 {
diff --git a/src/collection/sqlcollection/SqlMeta.h b/src/collection/sqlcollection/SqlMeta.h
index f19315d..7a3a2a0 100644
--- a/src/collection/sqlcollection/SqlMeta.h
+++ b/src/collection/sqlcollection/SqlMeta.h
@@ -223,7 +223,6 @@ class SqlArtist : public Meta::Artist
 
         virtual QString name() const { return m_name; }
         virtual QString prettyName() const { return m_name; } //change if necessary
-        virtual QString sortableName() const;
 
         void updateData( SqlCollection* collection, int id, const QString &name );
 
@@ -247,7 +246,6 @@ class SqlArtist : public Meta::Artist
         ArtistCapabilityDelegate *m_delegate;
         QString m_name;
         int m_id;
-        mutable QString m_modifiedName;
         bool m_tracksLoaded;
         Meta::TrackList m_tracks;
         bool m_albumsLoaded;
diff --git a/src/meta/Meta.cpp b/src/meta/Meta.cpp
index 98b4c50..765ea1b 100644
--- a/src/meta/Meta.cpp
+++ b/src/meta/Meta.cpp
@@ -381,6 +381,21 @@ Meta::Artist::operator==( const Meta::Artist &artist ) const
     return dynamic_cast<const void*>( this ) == dynamic_cast<const  void*>( &artist );
 }
 
+QString
+Meta::Artist::sortableName() const
+{
+    if ( m_sortableName.isEmpty() && !name().isEmpty() ) {
+        if ( name().startsWith( "the ", Qt::CaseInsensitive ) ) {
+            QString begin = name().left( 3 );
+            m_sortableName = QString( "%1, %2" ).arg( name(), begin );
+            m_sortableName = m_sortableName.mid( 4 );
+        }
+        else
+            m_sortableName = name();
+    }
+    return m_sortableName;
+}
+
 //Meta::Album
 
 void
diff --git a/src/meta/Meta.h b/src/meta/Meta.h
index 4d18aa3..0937263 100644
--- a/src/meta/Meta.h
+++ b/src/meta/Meta.h
@@ -306,8 +306,13 @@ namespace Meta
 
             virtual bool operator==( const Meta::Artist &artist ) const;
 
+            virtual QString sortableName() const;
+
         protected:
             virtual void notifyObservers() const;
+
+        private:
+            mutable QString m_sortableName;
     };
 
     class AMAROK_EXPORT Album : public MetaBase