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 616669 - [patch] Send artist and album sort order to DAAP clients
[patch] Send artist and album sort order to DAAP clients
Status: RESOLVED FIXED
Product: libdmapsharing
Classification: Other
Component: DAAP Client
git master
Other Linux
: Normal enhancement
: ---
Assigned To: W. Michael Petullo
W. Michael Petullo
Depends on:
Blocks:
 
 
Reported: 2010-04-23 17:13 UTC by Philippe Gauthier
Modified: 2010-05-08 09:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add artist and album sort order codes. (3.24 KB, patch)
2010-04-23 17:13 UTC, Philippe Gauthier
reviewed Details | Review
Patch to add client support of sort order codes (1.86 KB, patch)
2010-04-23 21:10 UTC, Philippe Gauthier
reviewed Details | Review
Patch to add artist and album sort order codes (combined) (5.63 KB, patch)
2010-04-26 15:15 UTC, Philippe Gauthier
none Details | Review
Patch to add artist and album sort order codes (final) (6.14 KB, patch)
2010-05-03 16:16 UTC, Philippe Gauthier
committed Details | Review
untested patch (5.76 KB, patch)
2010-05-06 12:57 UTC, Jonathan Matthew
none Details | Review

Description Philippe Gauthier 2010-04-23 17:13:58 UTC
Created attachment 159453 [details] [review]
Patch to add artist and album sort order codes.

This proposed patch adds the artist and album sort order content codes to DAAP. 

It allows clients to efficiently sort the tracks as they receive the list at connexion. Otherwise, the client has to wait until it receives the track file to read the sort order data. With some clients, this will cause a reordering of the track list and may break linear playing.

Tested with Rhythmbox 0.18.12 (git HEAD) as server, and iTunes 9.0 as client.
Comment 1 Jonathan Matthew 2010-04-23 20:48:19 UTC
Review of attachment 159453 [details] [review]:

It'd be great if you could add client side support for this too.  This would be done in the 'handle_song_listing' function in rb-daap-connection.c.

::: plugins/daap/rb-daap-share.c
@@ +903,3 @@
+	SONG_YEAR,
+	SORT_ARTIST,
+	SORT_ALBUM

these should be SONG_SORT_ARTIST and SONG_SORT_ALBUM
Comment 2 Philippe Gauthier 2010-04-23 21:02:51 UTC
I will look for implementing client support. You are right that it's probably just a matter of mapping back the content codes to the model.

The DAAP codes such as SONG_YEAR and SORT_ARTIST are based on the long code names. I think SORT_* should be left as is. It there a particular reason to follow a different pattern? For example:

dmap.itemid          -> ITEM_ID
dmap.containeritemid -> CONTAINER_ITEM_ID
daap.songyear        -> SONG_YEAR
daap.sortartist      -> SORT_ARTIST
Comment 3 Philippe Gauthier 2010-04-23 21:10:45 UTC
Created attachment 159457 [details] [review]
Patch to add client support of sort order codes
Comment 4 Jonathan Matthew 2010-04-23 21:40:34 UTC
I don't think there's any reason to reflect the inconsistency of the protocol's identifiers in our own.
Comment 5 Jonathan Matthew 2010-04-23 21:42:13 UTC
Review of attachment 159457 [details] [review]:

::: plugins/daap/rb-daap-connection.c
@@ +1092,3 @@
+		/* artist sort order */
+		if (sort_artist && *sort_artist != '\0') {
+			entry_set_string_prop (priv->db, entry, RHYTHMDB_PROP_ARTIST_SORTNAME, sort_artist);

I'd rather have an additional parameter to entry_set_string_prop that determines whether it sets the property to "Unknown" or leaves it unset if it's not given a value.
Comment 6 Philippe Gauthier 2010-04-26 15:15:47 UTC
Created attachment 159614 [details] [review]
Patch to add artist and album sort order codes (combined)

This matches merges the changes in previous patches and includes the last suggestions. However, the client portion of this code needs more testing.
Comment 7 Philippe Gauthier 2010-05-03 16:16:45 UTC
Created attachment 160201 [details] [review]
Patch to add artist and album sort order codes (final)

Properly generated patch (after learning about git-rebase) that implements sending and interpreting the proper DAAP sort order codes.
Comment 8 Jonathan Matthew 2010-05-06 12:40:36 UTC
I fixed up a few things - most notably that we weren't requesting the daap.sortartist and daap.sortalbum items from the server, so we'd never see them on the client side - and pushed this as commit 23f9b94.
Comment 9 Jonathan Matthew 2010-05-06 12:57:14 UTC
We should also add these to libdmapsharing, since we're probably going to switch to that for daap support soon.
Comment 10 Jonathan Matthew 2010-05-06 12:57:51 UTC
Created attachment 160434 [details] [review]
untested patch
Comment 11 W. Michael Petullo 2010-05-07 11:31:58 UTC
I just applied a modified patch to Git. See http://git.gnome.org/browse/libdmapsharing/commit/?id=c3f8959a29fb8a889df1583b2bf34a198c96bb96.
Comment 12 Jonathan Matthew 2010-05-07 11:40:23 UTC
This seems a little excessive.

@@ -597,6 +599,7 @@ dmap_structure_add (GNode *parent,
 	va_start (list, cc);
 
 	dmap_type = dmap_content_code_dmap_type (cc);
+	g_print ("%d %d %d %d\n\n\n", dmap_type, cc, DMAP_TYPE_SHORT, DMAP_TYPE_STRING);
 	gtype = dmap_content_code_gtype (cc);
 
 	item = g_new0(DMAPStructureItem, 1);
Comment 13 W. Michael Petullo 2010-05-08 09:14:37 UTC
> +    g_print ("%d %d %d %d\n\n\n", dmap_type, cc, DMAP_TYPE_SHORT,

I just removed this debug statement in the latest Git push.