diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-04-10 05:05:57 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-04-10 05:05:57 +0200 |
commit | 3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b (patch) | |
tree | b4ed07fbca5045fa139bcabdec8afc1a69aa135d /import.cpp | |
parent | 66f0d0e0ff9a8e6f8d80c0f4f75ae54c8eafcb92 (diff) | |
download | vdr-plugin-xmltv2vdr-3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b.tar.gz vdr-plugin-xmltv2vdr-3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b.tar.bz2 |
Added setting of parential rating in import
Diffstat (limited to 'import.cpp')
-rw-r--r-- | import.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -631,6 +631,7 @@ 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++) { char *rtype=strdup((*rating)[i]); @@ -641,15 +642,32 @@ bool cImport::PutEvent(cEPGSource *source, sqlite3 *db, cSchedule* schedule, { *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) + { + 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); } } +#if VDRVERSNUM >= 10711 || EPGHANDLER + if ((rv>0) && (rv<=18)) + { + event->SetParentalRating(rv); + } +#endif } if (((Flags & USE_STARRATING)==USE_STARRATING) && (xevent->StarRating()->Size())) |