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

Fix serving to iTunes 10



iTunes 10 is more picky about com.apple.itunes.mediakind. If it is
requested, it must be present in response. This patch fixes serving to
iTunes 10.
Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 853af1ee
......@@ -339,7 +339,14 @@ typedef enum {
SONG_TRACK_NUMBER,
SONG_USER_RATING,
SONG_YEAR,
SONG_HAS_VIDEO
SONG_HAS_VIDEO,
SONG_SMART_PLAYLIST,
SONG_IS_PODCAST_PLAYLIST,
SONG_SPECIAL_PLAYLIST,
SONG_SAVED_GENIUS,
SONG_MEDIAKIND,
HAS_CHILD_CONTAINERS,
PARENT_CONTAINER_ID
} DAAPMetaData;
static struct DMAPMetaDataMap meta_data_map[] = {
......@@ -380,6 +387,13 @@ static struct DMAPMetaDataMap meta_data_map[] = {
{"daap.sortalbum", SONG_SORT_ALBUM},
{"daap.sortartist", SONG_SORT_ARTIST},
{"com.apple.itunes.has-video", SONG_HAS_VIDEO},
{"com.apple.itunes.smart-playlist", SONG_SMART_PLAYLIST},
{"com.apple.itunes.is-podcast-playlist", SONG_IS_PODCAST_PLAYLIST},
{"com.apple.itunes.special-playlist", SONG_SPECIAL_PLAYLIST},
{"com.apple.itunes.saved-genius", SONG_SAVED_GENIUS},
{"com.apple.itunes.mediakind", SONG_MEDIAKIND},
{"dmap.haschildcontainers", HAS_CHILD_CONTAINERS},
{"dmap.parentcontainerid", PARENT_CONTAINER_ID},
{ NULL, 0}};
#define DAAP_ITEM_KIND_AUDIO 2
......@@ -679,6 +693,11 @@ add_entry_to_mlcl (gpointer id,
else
g_warning ("Sort album requested but not available");
}
if (_dmap_share_client_requested (mb->bits, SONG_MEDIAKIND)) {
gint mediakind;
g_object_get (record, "mediakind", &mediakind, NULL);
dmap_structure_add (mlit, DMAP_CC_AEMK, mediakind);
}
return;
}
......
......@@ -1141,6 +1141,14 @@ _dmap_share_add_playlist_to_mlcl (gpointer id, DMAPContainerRecord *record, gpoi
dmap_structure_add (mlit, DMAP_CC_MINM, name);
dmap_structure_add (mlit, DMAP_CC_MIMC, (gint32) num_songs);
/* FIXME: Is this getting music-specific? */
dmap_structure_add (mlit, DMAP_CC_FQUESCH, 0);
dmap_structure_add (mlit, DMAP_CC_MPCO, 0);
dmap_structure_add (mlit, DMAP_CC_AESP, 0);
dmap_structure_add (mlit, DMAP_CC_AEPP, 0);
dmap_structure_add (mlit, DMAP_CC_AEPS, 0);
dmap_structure_add (mlit, DMAP_CC_AESG, 0);
g_free (name);
return;
......
......@@ -77,6 +77,7 @@ static const DMAPContentCodeDefinition cc_defs[] = {
{DMAP_CC_MUTY, MAKE_CONTENT_CODE('m','u','t','y'), "dmap.updatetype", "muty", DMAP_TYPE_BYTE},
{DMAP_CC_MUDL, MAKE_CONTENT_CODE('m','u','d','l'), "dmap.deletedidlisting", "mudl", DMAP_TYPE_CONTAINER},
{DMAP_CC_MSMA, MAKE_CONTENT_CODE('m','s','m','a'), "dmap.speakermachineaddress", "msma", DMAP_TYPE_INT},
{DMAP_CC_FQUESCH, MAKE_CONTENT_CODE('f','?','c','h'), "dmap.haschildcontainers", "f?ch", DMAP_TYPE_BYTE},
{DMAP_CC_APRO, MAKE_CONTENT_CODE('a','p','r','o'), "daap.protocolversion", "apro", DMAP_TYPE_VERSION},
{DMAP_CC_AVDB, MAKE_CONTENT_CODE('a','v','d','b'), "daap.serverdatabases", "avdb", DMAP_TYPE_CONTAINER},
......@@ -122,7 +123,6 @@ static const DMAPContentCodeDefinition cc_defs[] = {
{DMAP_CC_APSO, MAKE_CONTENT_CODE('a','p','s','o'), "daap.playlistsongs", "apso", DMAP_TYPE_CONTAINER},
{DMAP_CC_PRSV, MAKE_CONTENT_CODE('p','r','s','v'), "daap.resolve", "prsv", DMAP_TYPE_CONTAINER},
{DMAP_CC_ARIF, MAKE_CONTENT_CODE('a','r','i','f'), "daap.resolveinfo", "arif", DMAP_TYPE_CONTAINER},
{DMAP_CC_AESV, MAKE_CONTENT_CODE('a','e','S','V'), "com.applie.itunes.music-sharing-version", "aesv", DMAP_TYPE_INT},
{DMAP_CC_MSAS, MAKE_CONTENT_CODE('m','s','a','s'), "daap.authentication.schemes", "msas", DMAP_TYPE_BYTE},
{DMAP_CC_AGRP, MAKE_CONTENT_CODE('a','g','r','p'), "daap.songgrouping", "agrp", DMAP_TYPE_STRING},
{DMAP_CC_AGAL, MAKE_CONTENT_CODE('a','g','a','l'), "daap.albumgrouping", "agal", DMAP_TYPE_CONTAINER},
......@@ -140,7 +140,13 @@ static const DMAPContentCodeDefinition cc_defs[] = {
{DMAP_CC_PRAT, MAKE_CONTENT_CODE('p','r','a','t'), "dpap.imagerating", "prat", DMAP_TYPE_INT},
{DMAP_CC_PCMT, MAKE_CONTENT_CODE('p','c','m','t'), "dpap.imagecomments", "pcmt", DMAP_TYPE_STRING},
{DMAP_CC_PRET, MAKE_CONTENT_CODE('p','r','e','t'), "dpap.pret", "pret", DMAP_TYPE_STRING},
{DMAP_CC_AESV, MAKE_CONTENT_CODE('a','e','S','V'), "com.apple.itunes.music-sharing-version", "aesv", DMAP_TYPE_INT},
{DMAP_CC_AEHV, MAKE_CONTENT_CODE('a','e','H','V'), "com.apple.itunes.has-video", "aeHV", DMAP_TYPE_BYTE},
{DMAP_CC_AESP, MAKE_CONTENT_CODE('a','e','S','P'), "com.apple.itunes.smart-playlist", "aeSP", DMAP_TYPE_BYTE},
{DMAP_CC_AEPP, MAKE_CONTENT_CODE('a','e','P','P'), "com.apple.itunes.is-podcast-playlist", "aePP", DMAP_TYPE_BYTE},
{DMAP_CC_AEPS, MAKE_CONTENT_CODE('a','e','P','S'), "com.apple.itunes.special-playlist", "aePS", DMAP_TYPE_BYTE},
{DMAP_CC_AESG, MAKE_CONTENT_CODE('a','e','S','G'), "com.apple.itunes.saved-genius", "aeSG", DMAP_TYPE_BYTE},
{DMAP_CC_AEMK, MAKE_CONTENT_CODE('a','e','M','K'), "com.apple.itunes.mediakind", "aeMK", DMAP_TYPE_BYTE},
/* DACP */
{DMAP_CC_CMPA, MAKE_CONTENT_CODE('c','m','p','a'), "dacp.contentcontainer", "cmpa", DMAP_TYPE_CONTAINER},
......
......@@ -76,6 +76,7 @@ typedef enum {
DMAP_CC_MUTY,
DMAP_CC_MUDL,
DMAP_CC_MSMA,
DMAP_CC_FQUESCH,
DMAP_CC_APRO,
DMAP_CC_AVDB,
......@@ -143,6 +144,12 @@ typedef enum {
/* iTunes 6.02+ */
DMAP_CC_AEHV,
DMAP_CC_AESP,
DMAP_CC_AEPP,
DMAP_CC_AEPS,
DMAP_CC_AESG,
DMAP_CC_AEMK,
/* DACP */
DMAP_CC_CMPA,
DMAP_CC_CMNM,
......
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