summaryrefslogtreecommitdiff
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
parent66f0d0e0ff9a8e6f8d80c0f4f75ae54c8eafcb92 (diff)
downloadvdr-plugin-xmltv2vdr-3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b.tar.gz
vdr-plugin-xmltv2vdr-3539d1a5106f2bfeb9d25bc5c14b97d53c8fb81b.tar.bz2
Added setting of parential rating in import
-rw-r--r--import.cpp20
-rw-r--r--maps.h10
-rw-r--r--po/de_DE.po5
-rw-r--r--po/it_IT.po5
-rw-r--r--setup.cpp7
-rw-r--r--xmltv2vdr.cpp4
6 files changed, 42 insertions, 9 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()))
diff --git a/maps.h b/maps.h
index 6c65622..042b596 100644
--- a/maps.h
+++ b/maps.h
@@ -11,10 +11,9 @@
#include <vdr/channels.h>
#include <vdr/tools.h>
-// Usage field definition
+// Flags field definition
-// Bit 0- 5 UNUSED
-// Bit 6-23 USE_ flags
+// Bit 0-23 USE_ flags
// Bit 24-30 OPT_ flags
// Bit 31 always zero
@@ -38,6 +37,9 @@
#define CREDITS_OTHERS 0x400000
#define CREDITS_LIST 0x800000
+#define OPT_RATING_TEXT 0x1000000
+#define OPT_CATEGORIES_TEXT 0x2000000
+
#define OPT_MERGELTEXT 0x10000000
#define OPT_APPEND 0x40000000
@@ -63,7 +65,7 @@ public:
class cTEXTMappings : public cList<cTEXTMapping>
{
public:
- cTEXTMapping *GetMap(const char *Name);
+ cTEXTMapping *GetMap(const char *Name);
void Remove();
};
diff --git a/po/de_DE.po b/po/de_DE.po
index f64ca30..045d50f 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-04-06 17:02+0200\n"
+"POT-Creation-Date: 2012-04-10 04:59+0200\n"
"PO-Revision-Date: 2010-12-23 23:59+0100\n"
"Last-Translator: Jochen Dolze <vdr@dolze.de>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -175,6 +175,9 @@ msgstr "einzeilig"
msgid "rating"
msgstr "Freigabe"
+msgid " rating in description"
+msgstr " Freigabe im Text"
+
msgid "video"
msgstr "Video"
diff --git a/po/it_IT.po b/po/it_IT.po
index 78ea021..3d724cf 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-04-06 17:02+0200\n"
+"POT-Creation-Date: 2012-04-10 04:59+0200\n"
"PO-Revision-Date: 2011-03-05 15:45+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -178,6 +178,9 @@ msgstr ""
msgid "rating"
msgstr "Valutazione"
+msgid " rating in description"
+msgstr ""
+
msgid "video"
msgstr "Video"
diff --git a/setup.cpp b/setup.cpp
index 5ebc6f2..bb13eec 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -515,7 +515,7 @@ void cMenuSetupXmltv2vdrLog::output(void)
int cur=Current();
Clear();
Add(NewTitle(tr("overview")));
- time_t nextrun=src->NextRunTime();
+ time_t nextrun=src->NextRunTime();
if (nextrun)
{
struct tm tm;
@@ -617,7 +617,7 @@ cMenuSetupXmltv2vdrLog::cMenuSetupXmltv2vdrLog(cPluginXmltv2vdr *Plugin, cEPGSou
lastrefresh=(time_t) 0;
font=NULL;
nextrun_str[0]=0;
-
+
cSkinDisplayMenu *disp=DisplayMenu();
if (disp)
{
@@ -944,6 +944,9 @@ void cMenuSetupXmltv2vdrChannelMap::output(void)
}
Add(new cMyMenuEditBitItem(tr("rating"),&flags,USE_RATING),true);
+#if VDRVERSNUM >= 10711 || EPGHANDLER
+ Add(new cMyMenuEditBitItem(tr(" rating in description"),&flags,OPT_RATING_TEXT),true);
+#endif
Add(new cMyMenuEditBitItem(tr("starrating"),&flags,USE_STARRATING),true);
Add(new cMyMenuEditBitItem(tr("review"),&flags,USE_REVIEW),true);
Add(new cMyMenuEditBitItem(tr("video"),&flags,USE_VIDEO),true);
diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp
index b34f855..08ff990 100644
--- a/xmltv2vdr.cpp
+++ b/xmltv2vdr.cpp
@@ -206,6 +206,8 @@ void cEPGTimer::Action()
struct stat statbuf;
if (stat(epgfile,&statbuf)==-1) return; // no database? -> exit immediately
if (!statbuf.st_size) return; // no database? -> exit immediately
+ if (Timers.BeingEdited()) return;
+ Timers.IncBeingEdited();
SetPriority(19);
if (ioprio_set(1,getpid(),7 | 3 << 13)==-1)
{
@@ -217,6 +219,7 @@ void cEPGTimer::Action()
if (!schedules)
{
delete schedulesLock;
+ Timers.DecBeingEdited();
return;
}
@@ -247,6 +250,7 @@ void cEPGTimer::Action()
}
delete xevent;
}
+ Timers.DecBeingEdited();
delete schedulesLock;
cSchedules::Cleanup(true);
}