diff --git a/src/daap.c b/src/daap.c index aa644f36..00f04fe0 100644 --- a/src/daap.c +++ b/src/daap.c @@ -269,8 +269,16 @@ DAAP_BLOCK *daap_response_songlist(void) { g = g && daap_add_int(mlit,"asdm",current->mtime); /* modified */ } - // g = g && daap_add_short(mlit,"asdc",0); /* # of discs */ - // g = g && daap_add_short(mlit,"asdn",0); /* disc number */ + if(current->total_discs) { + /* # of discs */ + g = g && daap_add_short(mlit,"asdc",current->total_discs); + } + + if(current->disc) { + /* disc number */ + g = g && daap_add_short(mlit,"asdn",current->disc); + } + // g = g && daap_add_char(mlit,"asdk",0); /* song datakind? */ // aseq - null string! diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index 80df1e2a..62d312d1 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -477,6 +477,14 @@ int scan_gettags(char *file, MP3FILE *pmp3) { used=1; pmp3->comment = utf8_text; DPRINTF(ERR_DEBUG," Comment: %s\n",pmp3->comment); + } else if(!strcmp(pid3frame->id,"TPOS")) { + tmp=(char*)utf8_text; + strsep(&tmp,"/"); + if(tmp) { + pmp3->total_discs=atoi(tmp); + } + pmp3->disc=atoi((char*)utf8_text); + DPRINTF(ERR_DEBUG," Disc %d of %d\n",pmp3->disc,pmp3->total_discs); } else if(!strcmp(pid3frame->id,"TRCK")) { tmp=(char*)utf8_text; strsep(&tmp,"/"); diff --git a/src/mp3-scanner.h b/src/mp3-scanner.h index 2b3b142c..e554ebb2 100644 --- a/src/mp3-scanner.h +++ b/src/mp3-scanner.h @@ -40,6 +40,9 @@ typedef struct tag_mp3file { int track; int total_tracks; + int disc; + int total_discs; + int mtime; int atime; int ctime;