Reply To: XBMC

#4612
barnseyboy
Participant

rpedde: i have been diggin through the xbmc code to see if i could spot why mt-daapd playlists have stopped working.

the body of the xbmc mt-daapd code is located in XBMCdocslibXDAAPlibXDAAP.c

the method Priv_DAAP_ClientHost_GetDatabaseItems is the routine for getting the details of individual items. in the code are a few ‘telling’ comments about support for mt-daapd including which xml nodes tend not to be populated by mt-daapd.

i went through all the items returned by mt-daapd and found that sometimes it doesnt return xml nodes for things which i guess are empty id3 tags.

e.g. one of the more empty items i could find in my music library..


-
112
1077
mp3
04-re-akshon_(remix).mp3
44100
3237049
225044

so my hypothesis (without being able to step through the xbmc code atm) is that its borking on some of the missing tags.

can you remember if the old (working) code for mt-daapd with xbmc saent back empty tags? is adding in empty tags for some of the key elements something you would consider? do you consider this a bug with xmbc not mt-daapd?

ive included the fragment from the xbmc code here, as you see the comments seem to indicate that certain values it expects mt-daapd not to provide have been commented out, but other items which mt-daapd does not always provide are left in.


for (i = 0; i < items.returnedcount; i++)
{
dmapGenericContainer *item = &(items.listitems);
DMAP_INT32 buf32;
/*DMAP_INT16 buf16;
DMAP_INT8 buf8;*/
DMAP_STRING buf;

if (dmapGeneric_LookupContainerItem_INT32(item, dmap_l("itemid"), &buf32) !=
DMAP_DATATYPE_INT32)
continue;

if (dmapGeneric_LookupContainerItem_STRING(item, dmap_l("itemname"), &buf) !=
DMAP_DATATYPE_STRING)
continue;
sizereq += strlen(buf) + 1;

if (dmapGeneric_LookupContainerItem_STRING(item, daap_l("songalbum"), &buf) ==
DMAP_DATATYPE_STRING)
sizereq += strlen(buf) + 1;

if (dmapGeneric_LookupContainerItem_STRING(item, daap_l("songartist"), &buf) ==
DMAP_DATATYPE_STRING)
sizereq += strlen(buf) + 1;

/*
* OPTIONAL - had to comment this out because mt-daapd doesn't provide all of these
* all of the time.
*
if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songbeatsperminute"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;

if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songbitrate"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;

if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songdisccount"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;

if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songdiscnumber"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;
*/

if (dmapGeneric_LookupContainerItem_STRING(item, daap_l("songgenre"), &buf) ==
DMAP_DATATYPE_STRING)
sizereq += strlen(buf) + 1;

if (dmapGeneric_LookupContainerItem_INT32(item, daap_l("songsamplerate"), &buf32) !=
DMAP_DATATYPE_INT32)
continue;

if (dmapGeneric_LookupContainerItem_INT32(item, daap_l("songsize"), &buf32) !=
DMAP_DATATYPE_INT32)
continue;

if (dmapGeneric_LookupContainerItem_INT32(item, daap_l("songtime"), &buf32) !=
DMAP_DATATYPE_INT32)
continue;

/* optional, see above re mt-daapd
if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songtrackcount"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;

if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songtracknumber"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;

if (dmapGeneric_LookupContainerItem_INT8(item, daap_l("songuserrating"), &buf8) !=
DMAP_DATATYPE_INT8)
continue;

if (dmapGeneric_LookupContainerItem_INT16(item, daap_l("songyear"), &buf16) !=
DMAP_DATATYPE_INT16)
continue;
*/

if (dmapGeneric_LookupContainerItem_STRING(item, daap_l("songformat"), &buf) !=
DMAP_DATATYPE_STRING)
continue;
sizereq += strlen(buf) + 1;
}