summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extpipe.h4
-rw-r--r--parse.cpp18
-rw-r--r--po/de_DE.po10
-rw-r--r--po/it_IT.po12
-rw-r--r--setup.cpp28
-rw-r--r--setup.h22
-rw-r--r--xmltv2vdr.cpp47
-rw-r--r--xmltv2vdr.h2
8 files changed, 91 insertions, 52 deletions
diff --git a/extpipe.h b/extpipe.h
index 8df5356..58a2ef1 100644
--- a/extpipe.h
+++ b/extpipe.h
@@ -12,6 +12,10 @@ private:
public:
cExtPipe(void);
~cExtPipe();
+ FILE *Out()
+ {
+ return f;
+ }
operator FILE* () const
{
return f;
diff --git a/parse.cpp b/parse.cpp
index e197de8..9fc9733 100644
--- a/parse.cpp
+++ b/parse.cpp
@@ -500,7 +500,9 @@ bool cParse::PutEvent(cSchedule* schedule, cEvent *event, cXMLTVEvent *xevent, c
(!strcasecmp(ctype,"actor"))) add=false;
if (((map->Flags() & CREDITS_DIRECTORS)!=CREDITS_DIRECTORS) &&
(!strcasecmp(ctype,"director"))) add=false;
- if (((map->Flags() & CREDITS_OTHERS)!=CREDITS_OTHERS) && (add)) add=false;
+ if (((map->Flags() & CREDITS_OTHERS)!=CREDITS_OTHERS) &&
+ (add) && (strcasecmp(ctype,"actor")) &&
+ (strcasecmp(ctype,"director"))) add=false;
if (add)
{
cTEXTMapping *text=TEXTMapping(ctype);
@@ -840,7 +842,7 @@ bool cParse::Process(char *buffer, int bufsize)
if (!channelid)
{
if (lerr!=PARSE_NOCHANNELID)
- esyslog("xmltv2vdr: '%s' missing channelid in xmltv file",name);
+ esyslog("xmltv2vdr: '%s' ERROR missing channelid in xmltv file",name);
lerr=PARSE_NOCHANNELID;
node=node->next;
continue;
@@ -849,7 +851,7 @@ bool cParse::Process(char *buffer, int bufsize)
if (!map)
{
if (lerr!=PARSE_NOMAPPING)
- esyslog("xmltv2vdr: '%s' no mapping for channelid %s",name,channelid);
+ esyslog("xmltv2vdr: '%s' ERROR no mapping for channelid %s",name,channelid);
lerr=PARSE_NOMAPPING;
xmlFree(channelid);
node=node->next;
@@ -878,7 +880,7 @@ bool cParse::Process(char *buffer, int bufsize)
if (!starttime)
{
if (lerr!=PARSE_XMLTVERR)
- esyslog("xmltv2vdr: '%s' no starttime - error in xmltv file?",name);
+ esyslog("xmltv2vdr: ERROR '%s' no starttime, check xmltv file",name);
lerr=PARSE_XMLTVERR;
xmlFree(channelid);
node=node->next;
@@ -922,7 +924,7 @@ bool cParse::Process(char *buffer, int bufsize)
if (!schedules)
{
if (lerr!=PARSE_NOSCHEDULES)
- esyslog("xmltv2vdr: '%s' cannot get schedules",name);
+ esyslog("xmltv2vdr: '%s' ERROR cannot get schedules",name);
lerr=PARSE_NOSCHEDULES;
node=node->next;
continue;
@@ -945,8 +947,8 @@ bool cParse::Process(char *buffer, int bufsize)
if (!schedule)
{
if (lerr!=PARSE_NOSCHEDULE)
- esyslog("xmltv2vdr: '%s' cannot get schedule for channel %s (no import)",
- name,channel->Name());
+ esyslog("xmltv2vdr: '%s' ERROR cannot get schedule for channel %s%s",
+ name,channel->Name(),addevents ? "" : " - try add option");
lerr=PARSE_NOSCHEDULE;
continue;
}
@@ -960,7 +962,7 @@ bool cParse::Process(char *buffer, int bufsize)
if (!schedule->Index())
{
if (lerr!=PARSE_EMPTYSCHEDULE)
- esyslog("xmltv2vdr: '%s' cannot merge into empty epg (%s)",
+ esyslog("xmltv2vdr: '%s' ERROR cannot merge into empty epg (%s) - try add optiopn",
name,channel->Name());
lerr=PARSE_EMPTYSCHEDULE;
}
diff --git a/po/de_DE.po b/po/de_DE.po
index eb35abf..bfaeea9 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: 2011-06-29 15:11+0200\n"
+"POT-Creation-Date: 2011-07-05 20:47+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"
@@ -147,12 +147,12 @@ msgstr " Sonstige"
msgid " output"
msgstr " Ausgabe"
-msgid "singleline"
-msgstr "einzeilig"
-
msgid "multiline"
msgstr "mehrzeilig"
+msgid "singleline"
+msgstr "einzeilig"
+
msgid "rating"
msgstr "Freigabe"
@@ -186,5 +186,3 @@ msgstr "xmltv2vdr plugin ist noch aktiv"
msgid "Imports xmltv epg into vdr"
msgstr "Importiert xmltv epg in den VDR"
-#~ msgid "With"
-#~ msgstr "Mit"
diff --git a/po/it_IT.po b/po/it_IT.po
index 8c51786..32d41ac 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: 2011-06-29 15:11+0200\n"
+"POT-Creation-Date: 2011-07-05 20:47+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"
@@ -150,10 +150,10 @@ msgstr " altro gruppo"
msgid " output"
msgstr ""
-msgid "singleline"
+msgid "multiline"
msgstr ""
-msgid "multiline"
+msgid "singleline"
msgstr ""
msgid "rating"
@@ -189,9 +189,3 @@ msgstr "Plugin XMLTV2VDR ancora in esecuzione"
msgid "Imports xmltv epg into vdr"
msgstr "Importa EPG di XMLTV in VDR"
-#~ msgid "With"
-#~ msgstr "Con "
-
-#, fuzzy
-#~ msgid " add in a list"
-#~ msgstr " aggiungi ad una lista"
diff --git a/setup.cpp b/setup.cpp
index bf2653f..507f85d 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -57,9 +57,17 @@ cMenuSetupXmltv2vdr::cMenuSetupXmltv2vdr(cPluginXmltv2vdr *Plugin)
wakeup=baseplugin->WakeUp;
upstart=baseplugin->UpStart;
exectime=baseplugin->ExecTime();
+ cs=NULL;
+ cm=NULL;
Output();
}
+cMenuSetupXmltv2vdr::~cMenuSetupXmltv2vdr()
+{
+ if (cs) cs->ClearMenu();
+ if (cm) cm->ClearMenu();
+}
+
void cMenuSetupXmltv2vdr::Output(void)
{
if (!baseplugin) return;
@@ -202,12 +210,14 @@ eOSState cMenuSetupXmltv2vdr::edit()
{
if ((Current()>=sourcesBegin) && (Current()<=sourcesEnd))
{
- return AddSubMenu(new cMenuSetupXmltv2vdrChannelSource(baseplugin,this,Current()-sourcesBegin));
+ cs=new cMenuSetupXmltv2vdrChannelSource(baseplugin,this,Current()-sourcesBegin);
+ return AddSubMenu(cs);
}
if ((Current()>=mappingBegin) && (Current()<=mappingEnd))
{
- return AddSubMenu(new cMenuSetupXmltv2vdrChannelMap(baseplugin,this,Current()-mappingBegin));
+ cm=new cMenuSetupXmltv2vdrChannelMap(baseplugin,this,Current()-mappingBegin);
+ return AddSubMenu(cm);
}
if (Current()==mappingEntry)
{
@@ -634,8 +644,12 @@ cMenuSetupXmltv2vdrChannelSource::cMenuSetupXmltv2vdrChannelSource(cPluginXmltv2
cMenuSetupXmltv2vdrChannelSource::~cMenuSetupXmltv2vdrChannelSource()
{
+ if (menu)
+ {
+ menu->Output();
+ menu->ClearCS();
+ }
if (sel) delete [] sel;
- if (menu) menu->Output();
}
cOsdItem *cMenuSetupXmltv2vdrChannelSource::newtitle(const char *s)
@@ -728,8 +742,12 @@ cMenuSetupXmltv2vdrChannelMap::cMenuSetupXmltv2vdrChannelMap(cPluginXmltv2vdr *P
cMenuSetupXmltv2vdrChannelMap::~cMenuSetupXmltv2vdrChannelMap()
{
+ if (menu)
+ {
+ menu->Output();
+ menu->ClearCM();
+ }
if (map) delete map;
- if (menu) menu->Output();
}
int cMenuSetupXmltv2vdrChannelMap::getdaysmax()
@@ -814,7 +832,7 @@ void cMenuSetupXmltv2vdrChannelMap::output(void)
Add(new cMyMenuEditBitItem(tr(" actors"),&flags,CREDITS_ACTORS),true);
Add(new cMyMenuEditBitItem(tr(" director"),&flags,CREDITS_DIRECTORS),true);
Add(new cMyMenuEditBitItem(tr(" other crew"),&flags,CREDITS_OTHERS),true);
- Add(new cMyMenuEditBitItem(tr(" output"),&flags,CREDITS_LIST,tr("singleline"),tr("multiline")),true);
+ Add(new cMyMenuEditBitItem(tr(" output"),&flags,CREDITS_LIST,tr("multiline"),tr("singleline")),true);
}
Add(new cMyMenuEditBitItem(tr("rating"),&flags,USE_RATING),true);
diff --git a/setup.h b/setup.h
index 6dfa156..06207f8 100644
--- a/setup.h
+++ b/setup.h
@@ -22,6 +22,9 @@ public:
cMyMenuEditBitItem(const char *Name, uint *Value, uint Mask, const char *FalseString=NULL, const char *TrueString=NULL);
};
+class cMenuSetupXmltv2vdrChannelSource;
+class cMenuSetupXmltv2vdrChannelMap;
+
class cMenuSetupXmltv2vdr : public cMenuSetupPage
{
protected:
@@ -29,6 +32,8 @@ protected:
private:
cStringList channels;
cPluginXmltv2vdr *baseplugin;
+ cMenuSetupXmltv2vdrChannelSource *cs;
+ cMenuSetupXmltv2vdrChannelMap *cm;
int mappingBegin,mappingEnd;
int sourcesBegin,sourcesEnd;
int mappingEntry;
@@ -40,7 +45,16 @@ private:
int upstart;
public:
void Output(void);
+ void ClearCS()
+ {
+ cs=NULL;
+ }
+ void ClearCM()
+ {
+ cm=NULL;
+ }
cMenuSetupXmltv2vdr(cPluginXmltv2vdr *Plugin);
+ ~cMenuSetupXmltv2vdr();
virtual eOSState ProcessKey(eKeys Key);
cStringList *ChannelList()
{
@@ -87,6 +101,10 @@ private:
public:
cMenuSetupXmltv2vdrChannelSource(cPluginXmltv2vdr *Plugin, cMenuSetupXmltv2vdr *Menu, int Index);
~cMenuSetupXmltv2vdrChannelSource();
+ void ClearMenu()
+ {
+ menu=NULL;
+ }
};
class cMenuSetupXmltv2vdrChannelMap : public cMenuSetupPage
@@ -115,6 +133,10 @@ public:
void AddChannel2Map(int ChannelNumber);
bool EPGMappingExists(tChannelID ChannelID);
virtual eOSState ProcessKey(eKeys Key);
+ void ClearMenu()
+ {
+ menu=NULL;
+ }
};
class cMenuSetupXmltv2vdrChannelsVDR : public cOsdMenu
diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp
index ad4e575..e91689c 100644
--- a/xmltv2vdr.cpp
+++ b/xmltv2vdr.cpp
@@ -54,7 +54,7 @@ void cEPGExecutor::Action()
while (retries<2)
{
ret=epgs->Execute();
- if (!ret)
+ if ((ret!=0) && (ret<128))
{
dsyslog("xmltv2vdr: waiting 60 seconds (%i)",retries);
sleep(60);
@@ -65,9 +65,9 @@ void cEPGExecutor::Action()
break;
}
}
- if (ret) break; // TODO: check if we must execute second/third source!
+ if (!ret) break; // TODO: check if we must execute second/third source!
}
- if (ret) cSchedules::Cleanup(true);
+ if (!ret) cSchedules::Cleanup(true);
}
// -------------------------------------------------------------
@@ -163,14 +163,14 @@ bool cEPGSource::ReadConfig()
return false;
}
-bool cEPGSource::Execute()
+int cEPGSource::Execute()
{
if (!ready2parse) return false;
if (!parse) return false;
char *result=NULL;
int l=0;
- bool ret=true;
+ int ret=0;
if (pipe)
{
cExtPipe p;
@@ -178,7 +178,7 @@ bool cEPGSource::Execute()
{
dsyslog("xmltv2vdr: '%s' executing epgsource",name);
int c;
- while ((c=fgetc(p))!=EOF)
+ while ((c=fgetc(p.Out()))!=EOF)
{
if (l%20==0) result=(char *) realloc(result, l+21);
result[l++]=c;
@@ -193,27 +193,27 @@ bool cEPGSource::Execute()
result[l]=0;
if (!parse->Process(result,l))
{
- esyslog("xmltv2vdr: '%s' failed to parse output",name);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR failed to parse output",name);
+ ret=141;
}
}
else
{
- esyslog("xmltv2vdr: '%s' epgsource returned with %i",name,returncode);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR epgsource returned %i",name,returncode);
+ ret=returncode;
}
}
else
{
- esyslog("xmltv2vdr: '%s' failed to execute",name);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR failed to execute",name);
+ ret=126;
}
if (result) free(result);
}
else
{
- esyslog("xmltv2vdr: '%s' failed to open pipe",name);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR failed to open pipe",name);
+ ret=141;
}
}
else
@@ -238,33 +238,33 @@ bool cEPGSource::Execute()
if (!parse->Process(result,l))
{
esyslog("xmltv2vdr: '%s' failed to parse output",name);
- ret=false;
+ ret=149;
}
}
else
{
- esyslog("xmltv2vdr: '%s' failed to read '%s'",name,fname);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR failed to read '%s'",name,fname);
+ ret=149;
}
free(result);
}
else
{
- esyslog("xmltv2vdr: '%s' out of memory",name);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR out of memory",name);
+ ret=134;
}
}
else
{
- esyslog("xmltv2vdr: '%s' failed to stat '%s'",name,fname);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR failed to stat '%s'",name,fname);
+ ret=157;
}
close(fd);
}
else
{
- esyslog("xmltv2vdr: '%s' failed to open '%s'",name,fname);
- ret=false;
+ esyslog("xmltv2vdr: '%s' ERROR failed to open '%s'",name,fname);
+ ret=157;
}
free(fname);
}
@@ -403,6 +403,7 @@ void cPluginXmltv2vdr::removeepgsources()
cEPGMapping *cPluginXmltv2vdr::EPGMapping(const char *ChannelName)
{
+ if (!ChannelName) return NULL;
if (!epgmappings.Count()) return NULL;
for (cEPGMapping *maps=epgmappings.First(); maps; maps=epgmappings.Next(maps))
{
diff --git a/xmltv2vdr.h b/xmltv2vdr.h
index 0a565c2..3287a6a 100644
--- a/xmltv2vdr.h
+++ b/xmltv2vdr.h
@@ -56,7 +56,7 @@ private:
public:
cEPGSource(const char *Name,cEPGMappings *Maps,cTEXTMappings *Texts);
~cEPGSource();
- bool Execute();
+ int Execute();
void Store(void);
void ChangeChannelSelection(int *Selection);
cEPGChannels *ChannelList()