GNOME Bugzilla – Bug 603981
Rhythmbox ignores artist_sortname and album_sortname tags when ordering your music
Last modified: 2009-12-07 20:44:14 UTC
Currently my artists are sorted using the artist tag of a song. This results in bands such as The Kills, The Prodigy, The Strokes, etc all being next to eachother, when they should actually be sorted under, K, P, and S respectively. Simply ignoring words such as "The" is not an option. But making use of the artist_sortname (and album_sortname) tags, if present, is. Rhythmbox currently loads the correct metadata from files and keeps it under the RHYTHMDB_PROP_ARTIST_SORTNAME and RHYTHMDB_PROP_ALBUM_SORTNAME properties of an entry. But it ignores these properties when sorting. Both the entry view widget and the property view widget sort incorrectly.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 133444 ***
Created attachment 149252 [details] [review] Patch which fixes the bug This uses the following method to fix the bug: To make the entry view sort correctly, we make the entry's RHYTHMDB_PROP_ARTIST_SORT_KEY be generated from artist_sortname instead of artist if artist_sortname is not a null string. If it is, the sort key is generated from artist as was done before. (Also does the same for the album equivelants) To make the property view sort correctly, when the property model's "propid" is set to RHYTHMDB_PROP_ARTIST, the sort_propid is set to RHYTHMDB_PROP_ARTIST_SORTNAME. Same for album equivelants. This however creates the problem of when entry's do not have a sortname (it is a null string). To fix this we change rhythmdb_entry_get_string so that when trying to get RHYTHMDB_PROP_ARTIST_SORTNAME, if entry->artist_sortname is a null string, entry->artist is returned instead. I'm not 100% sure if this is okay in principle, but it doesn't appear to break anything.
Please attach your patch to bug 133444. This bug is closed.