I've managed to successfully change rb's code to sort artist names properly,
taking advantage of the artist_sortname field (and i fixed album_sortname
while i was at it). I think it is a bug that rb doesn't take advantage of
these fields but before opening a bug report and attaching a patch i'd like
to check if what i've done is acceptable or if there'd be a much better way.

What i've done is:

to fix the list of tracks (the entry view) i've
changed rhythmdb_entry_get_string. Now, when
given RHYTHMDB_PROP_ARTIST_SORT_KEY, it checks if the artist_sortname is a
null string. If it is it returns rb_refstring_get_sort_key (entry->artist)
as normal. If it is non-null it returns rb_refstring_get_sort_key
(entry->artist_sortname). I've done the same for album sortname aswell.

to fix the browser (the property view) i've
changed rhythmdb_property_model_set_property. now when setting the propid
to RHYTHMDB_PROP_ARTIST or RHYTHMDB_PROP_ALBUM it sets the sort_propid
to RHYTHMDB_PROP_ARTIST_SORTNAME and RHYTHMDB_PROP_ALBUM_SORTNAME
respectively.

the problem with that however was that the vast majority of my music
collection (and probably most people's does not have sortnames set. To get
around this i edited rhythmdb_entry_get_string again so that when trying to
get the artist sortname or album sortname, if these values were null strings
it returns the normal artist or album instead.

Is there are problem with returning the plain old artist instead of artist
sortname if there is no artist sortname property? Will this affect any other
pieces of code? I've had no problems.

Should i go ahead and file a bug and attach a patch? (and also how do i
create a patch? i've cloned the git repo and made my changes. don't know
what to do next..)

Cheers,

Jamie
_______________________________________________
rhythmbox-devel mailing list
rhythmbox-devel@gnome.org
http://mail.gnome.org/mailman/listinfo/rhythmbox-devel

Reply via email to