summaryrefslogtreecommitdiff
path: root/import.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-04-10 05:05:57 +0200
committerJochen Dolze <vdr@dolze.de>2012-04-10 05:05:57 +0200
commit3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b (patch)
treeb4ed07fbca5045fa139bcabdec8afc1a69aa135d /import.cpp
parent66f0d0e0ff9a8e6f8d80c0f4f75ae54c8eafcb92 (diff)
downloadvdr-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.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/import.cpp b/import.cpp
index 59d8543..efcd649 100644
--- a/import.cpp
+++ b/import.cpp
@@ -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()))