File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
mythtv/programs/mythfilldatabase Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -371,12 +371,20 @@ ProgInfo *XMLTVParser::parseProgram(QDomElement &element)
371
371
// In the case of uk_rt it's not unknown for a recommendation
372
372
// to be given to programmes which are 'so bad, you have to
373
373
// watch!'
374
+ //
375
+ // XMLTV uses zero based ratings and signals no rating by absence.
376
+ // A rating from 1 to 5 is encoded as 0/4 to 4/4.
377
+ // MythTV uses zero to signal no rating!
378
+ // The same rating is encoded as 0.2 to 1.0 with steps of 0.2, it
379
+ // is not encoded as 0.0 to 1.0 with steps of 0.25 because
380
+ // 0 signals no rating!
381
+ // See http://xmltv.cvs.sourceforge.net/viewvc/xmltv/xmltv/xmltv.dtd?revision=1.47&view=markup#l539
374
382
item = values.item (0 ).toElement ();
375
383
if (!item.isNull ())
376
384
{
377
385
stars = getFirstText (item);
378
- num = stars.section (' /' , 0 , 0 );
379
- den = stars.section (' /' , 1 , 1 );
386
+ num = stars.section (' /' , 0 , 0 ) + 1 ;
387
+ den = stars.section (' /' , 1 , 1 ) + 1 ;
380
388
if (0.0 < den.toFloat ())
381
389
rating = num.toFloat ()/den.toFloat ();
382
390
}
You can’t perform that action at this time.
0 commit comments