diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-04-11 02:36:08 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-04-11 02:36:08 +0200 |
commit | 5d943515babc18cba0576f21f4c89a389d5f60c0 (patch) | |
tree | e237a03b56a840b495c93af1dda9acbbb5938818 /import.cpp | |
parent | 3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b (diff) | |
download | vdr-plugin-xmltv2vdr-5d943515babc18cba0576f21f4c89a389d5f60c0.tar.gz vdr-plugin-xmltv2vdr-5d943515babc18cba0576f21f4c89a389d5f60c0.tar.bz2 |
Added full parential rating support
Diffstat (limited to 'import.cpp')
-rw-r--r-- | import.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
@@ -630,42 +630,36 @@ bool cImport::PutEvent(cEPGSource *source, sqlite3 *db, cSchedule* schedule, if (((Flags & USE_RATING)==USE_RATING) && (xevent->Rating()->Size())) { - cXMLTVStringList *rating=xevent->Rating(); - int rv=0; - for (int i=0; i<rating->Size(); i++) +#if VDRVERSNUM < 10711 && !EPGHANDLER + Flags|=OPT_RATING_TEXT; // always add to text if we dont have the internal tag! +#endif + if ((Flags & OPT_RATING_TEXT)==OPT_RATING_TEXT) { - char *rtype=strdup((*rating)[i]); - if (rtype) + cXMLTVStringList *rating=xevent->Rating(); + for (int i=0; i<rating->Size(); i++) { - char *rval=strchr(rtype,'|'); - if (rval) + char *rtype=strdup((*rating)[i]); + if (rtype) { - *rval=0; - rval++; -#if VDRVERSNUM < 10711 && !EPGHANDLER - description=Add2Description(description,rtype); - description=Add2Description(description,": "); - description=Add2Description(description,rval); - description=Add2Description(description,"\n"); -#else - if ((Flags & OPT_RATING_TEXT)==OPT_RATING_TEXT) + char *rval=strchr(rtype,'|'); + if (rval) { + *rval=0; + rval++; + description=Add2Description(description,rtype); description=Add2Description(description,": "); description=Add2Description(description,rval); description=Add2Description(description,"\n"); } - int r=atoi(rval); - if (r>rv) rv=r; -#endif + free(rtype); } - free(rtype); } } #if VDRVERSNUM >= 10711 || EPGHANDLER - if ((rv>0) && (rv<=18)) + if (xevent->ParentalRating()) { - event->SetParentalRating(rv); + event->SetParentalRating(xevent->ParentalRating()); } #endif } |