Add smart playlist clause to playlist query

This commit is contained in:
Ron Pedde 2005-04-02 04:33:04 +00:00
parent f7bd776d5f
commit 158a76ae16
3 changed files with 15 additions and 2 deletions

View File

@ -171,7 +171,7 @@ DAAP_ITEMS taglist[] = {
{ 0x01, "aeSP", "com.apple.itunes.smart-playlist" },
/* iTunes 4.5+ */
{ 0x01, "msas", "dmap.authenticationschemes" },
{ 0x05, "ascd", "daap.songcodectype" },
{ 0x05, "ascd", "daap.songcodectype" }, /* there is a songcodec subtype, too */
{ 0x09, "agrp", "daap.songgrouping" },
{ 0x05, "aeSV", "com.apple.itunes.music-sharing-version" },
{ 0x05, "aePI", "com.apple.itunes.itms-playlistid" },
@ -179,6 +179,10 @@ DAAP_ITEMS taglist[] = {
{ 0x05, "aeGI", "com.apple.iTunes.itms-genreid" },
{ 0x05, "aeAI", "com.apple.iTunes.itms-artistid" },
{ 0x05, "aeSI", "com.apple.iTunes.itms-songid" },
/* mt-daapd specific */
{ 0x09, "MSPS", "org.mt-daapd.smart-playlist-spec" },
{ 0x00, NULL, NULL }
};
@ -220,6 +224,8 @@ static METAMAP db_metamap[] = {
{ "daap.songtracknumber", metaSongTrackNumber },
{ "daap.songuserrating", metaSongUserRating },
{ "daap.songyear", metaSongYear },
/* mt-daapd specific */
{ "org.mt-daapd.smart-playlist-spec", metaMTDSmartPlaylistSpec },
{ 0, 0 }
};

View File

@ -64,7 +64,10 @@ typedef enum {
metaSongTrackCount,
metaSongTrackNumber,
metaSongUserRating,
metaSongYear
metaSongYear,
/* mt-daapd specific */
metaMTDSmartPlaylistSpec
} MetaFieldName_t;
typedef enum {

View File

@ -810,6 +810,8 @@ int db_sqlite_get_size(DBQUERYINFO *pinfo, char **valarray) {
size += 12; /* mimc */
size += 9; /* aeSP */
size += (8 + strlen(valarray[1])); /* minm */
if((valarray[2]) && atoi(valarray[2])) /* MSPS */
size += (8 + strlen(valarray[4]));
return size;
break;
case queryTypeItems:
@ -963,6 +965,8 @@ int db_sqlite_build_dmap(DBQUERYINFO *pinfo, char **valarray, char *presult, int
current += db_dmap_add_int(current,"mimc",atoi(valarray[3]));
current += db_dmap_add_char(current,"aeSP",atoi(valarray[2]));
current += db_dmap_add_string(current,"minm",valarray[1]);
if((valarray[2]) && atoi(valarray[2]))
current += db_dmap_add_string(current,"MSPS",valarray[4]);
break;
case queryTypeItems:
case queryTypePlaylistItems: /* essentially the same query */