Reply To: svn-1696 problems with id3v2 ratings?

#18236
fizze
Participant

Wow – you beat me to it 😉
I’ve just found the corresponding source lines in scan-mp3.c – line ~466
http://trac.fireflymediaserver.org/browser/trunk/src/scan-mp3.c

It’s reading the POPM alright, but the decoding seems to be specific to iTunes.
Songbird translates one star to 30, two stars to 50, etc.
And the ratings are being written decimal.

However, when firefly reads a song with 5 stars (90) from songbird for instance, it’s being translated to 40.

466 	        if((!strcmp(pid3frame->id,"POPM")) && (pid3frame->nfields == 3)) {
467 rating = id3_field_getint(&pid3frame->fields[1]);
468 if(rating >= 0x01)
469 pmp3->rating = 20;
470 if(rating >= 0x40)
471 pmp3->rating = 40;
472 if(rating >= 0x80)
473 pmp3->rating = 60;
474 if(rating >= 0xC4)
475 pmp3->rating = 80;
476 if(rating >= 0xFF)
477 pmp3->rating = 100;

Which effectively breaks songbird’s ratings into firefly. I’ll patch my firefly and let you know.

edit:
Commenting the above ifs out and replacing it with this:

pmp3->rating = rating; 

does the trick.

Bear in mind that I don’t use iTunes though, so YMMV.