Commit c3f8959a authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Send artist and album sort order to DAAP clients

https://bugzilla.gnome.org/show_bug.cgi?id=616669

Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 7b85e01c
Name: libdmapsharing
Version: 1.9.0.14
Version: 1.9.0.16
Release: 1%{?dist}
License: LGPLv2+
Source: http://downloads.sourceforge.net/%name/%{name}-%{version}.tar.gz
......@@ -58,6 +58,9 @@ rm -rf $RPM_BUILD_ROOT
%postun -p /sbin/ldconfig
%changelog
* Sun Apr 04 2010 W. Michael Petullo <mike[@]flyn.org> - 1.9.0.16-1
- New upstream version.
* Sun Nov 29 2009 W. Michael Petullo <mike[@]flyn.org> - 1.9.0.14-1
- New upstream version.
......
......@@ -32,7 +32,6 @@
<chapter>
<title>Libdmapsharing Objects and Interfaces</title>
<xi:include href="xml/daap-connection.xml"/>
<xi:include href="xml/daap-record.xml"/>
<xi:include href="xml/daap-share.xml"/>
<xi:include href="xml/dmap-connection.xml"/>
......
......@@ -51,6 +51,13 @@ daap_record_init (DAAPRecordInterface *iface)
"Unknown",
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_string ("sort-album",
"Album sort name",
"Album sort name",
"Unknown",
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_string ("artist",
"Song artist",
......@@ -58,6 +65,13 @@ daap_record_init (DAAPRecordInterface *iface)
"Unknown",
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_string ("sort-artist",
"Song artist sort name",
"Song artist sort name",
"Unknown",
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_string ("genre",
"Song genre",
......
......@@ -368,6 +368,8 @@ typedef enum {
SONG_RELATIVE_VOLUME,
SONG_SAMPLE_RATE,
SONG_SIZE,
SONG_SORT_ALBUM,
SONG_SORT_ARTIST,
SONG_START_TIME,
SONG_STOP_TIME,
SONG_TIME,
......@@ -413,6 +415,8 @@ static struct DMAPMetaDataMap meta_data_map[] = {
{"daap.songtracknumber", SONG_TRACK_NUMBER},
{"daap.songuserrating", SONG_USER_RATING},
{"daap.songyear", SONG_YEAR},
{"daap.sortalbum", SONG_SORT_ALBUM},
{"daap.sortartist", SONG_SORT_ARTIST},
{"com.apple.itunes.has-video", SONG_HAS_VIDEO}};
#define DAAP_ITEM_KIND_AUDIO 2
......@@ -691,6 +695,17 @@ add_entry_to_mlcl (gpointer id, DMAPRecord *record, gpointer _mb)
g_object_get (record, "has-video", &has_video, NULL);
dmap_structure_add (mlit, DMAP_CC_AEHV, has_video);
}
if (_dmap_share_client_requested (mb->bits, SONG_SORT_ARTIST)) {
gchar *sort_artist;
g_object_get (record, "sort-artist", &sort_artist, NULL);
dmap_structure_add (mlit, DMAP_CC_ASSA, sort_artist);
}
if (_dmap_share_client_requested (mb->bits, SONG_SORT_ALBUM)) {
gchar *sort_album;
g_object_get (record, "sort-album", &sort_album, NULL);
dmap_structure_add (mlit, DMAP_CC_ASSU, sort_album);
}
return;
}
......
......@@ -952,6 +952,8 @@ handle_song_listing (DMAPConnection *connection,
const gchar *format = NULL;
const gchar *genre = NULL;
const gchar *streamURI = NULL;
const gchar *sort_artist = NULL;
const gchar *sort_album = NULL;
gint length = 0;
gint track_number = 0;
gint disc_number = 0;
......@@ -1004,6 +1006,12 @@ handle_song_listing (DMAPConnection *connection,
case DMAP_CC_ASUL:
streamURI = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASSA:
sort_artist = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASSU:
sort_album = g_value_get_string (&(meta_item->content));
break;
default:
break;
}
......@@ -1044,6 +1052,8 @@ handle_song_listing (DMAPConnection *connection,
"album", album,
"artist", artist,
"genre", genre,
"sort-artist", sort_artist,
"sort-album", sort_album,
NULL);
g_hash_table_insert (priv->item_id_to_uri, GINT_TO_POINTER (item_id), g_strdup (uri));
g_free (uri);
......@@ -1556,10 +1566,11 @@ dmap_connection_do_something (DMAPConnection *connection)
g_debug ("Getting DAAP song listing");
path = g_strdup_printf ("/databases/%i/items?session-id=%u&revision-number=%i"
"&meta=dmap.itemid,dmap.itemname,daap.songalbum,"
"daap.songartist,daap.daap.songgenre,daap.songsize,"
"daap.songartist,daap.songgenre,daap.songsize,"
"daap.songtime,daap.songtrackcount,daap.songtracknumber,"
"daap.songyear,daap.songformat,daap.songgenre,"
"daap.songbitrate,daap.songdiscnumber,daap.songdataurl",
"daap.songyear,daap.songformat,"
"daap.songbitrate,daap.songdiscnumber,daap.songdataurl,"
"daap.sortartist,daap.sortalbum",
priv->database_id,
priv->session_id,
priv->revision_number);
......
......@@ -111,6 +111,8 @@ static const DMAPContentCodeDefinition cc_defs[] = {
{DMAP_CC_ASYR, MAKE_CONTENT_CODE('a','s','y','r'), "daap.songyear", "asyr", DMAP_TYPE_SHORT},
{DMAP_CC_ASDK, MAKE_CONTENT_CODE('a','s','d','k'), "daap.songdatakind", "asdk", DMAP_TYPE_BYTE},
{DMAP_CC_ASUL, MAKE_CONTENT_CODE('a','s','u','l'), "daap.songdataurl", "asul", DMAP_TYPE_STRING},
{DMAP_CC_ASSU, MAKE_CONTENT_CODE('a','s','s','u'), "daap.sortalbum", "assu", DMAP_TYPE_STRING},
{DMAP_CC_ASSA, MAKE_CONTENT_CODE('a','s','s','a'), "daap.sortartist", "assa", DMAP_TYPE_STRING},
{DMAP_CC_APLY, MAKE_CONTENT_CODE('a','p','l','y'), "daap.databaseplaylists", "aply", DMAP_TYPE_CONTAINER},
{DMAP_CC_ABPL, MAKE_CONTENT_CODE('a','b','p','l'), "daap.baseplaylist", "abpl", DMAP_TYPE_BYTE},
{DMAP_CC_APSO, MAKE_CONTENT_CODE('a','p','s','o'), "daap.playlistsongs", "apso", DMAP_TYPE_CONTAINER},
......@@ -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);
......
......@@ -110,6 +110,8 @@ typedef enum {
DMAP_CC_ASYR,
DMAP_CC_ASDK,
DMAP_CC_ASUL,
DMAP_CC_ASSU,
DMAP_CC_ASSA,
DMAP_CC_APLY,
DMAP_CC_ABPL,
DMAP_CC_APSO,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment