After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 603981 - Rhythmbox ignores artist_sortname and album_sortname tags when ordering your music
Rhythmbox ignores artist_sortname and album_sortname tags when ordering your ...
Status: RESOLVED DUPLICATE of bug 133444
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-07 14:38 UTC by Jamie Nicol
Modified: 2009-12-07 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which fixes the bug (2.36 KB, patch)
2009-12-07 14:46 UTC, Jamie Nicol
none Details | Review

Description Jamie Nicol 2009-12-07 14:38:11 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.
Comment 1 Jonathan Matthew 2009-12-07 14:43:36 UTC
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 ***
Comment 2 Jamie Nicol 2009-12-07 14:46:41 UTC
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.
Comment 3 Jonathan Matthew 2009-12-07 20:44:14 UTC
Please attach your patch to bug 133444.  This bug is closed.