Add disc number info

This commit is contained in:
Ron Pedde 2004-02-18 20:34:08 +00:00
parent 1c26070a38
commit 6f4df7885b
3 changed files with 21 additions and 2 deletions

View File

@ -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!

View File

@ -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,"/");

View File

@ -40,6 +40,9 @@ typedef struct tag_mp3file {
int track;
int total_tracks;
int disc;
int total_discs;
int mtime;
int atime;
int ctime;