summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2011-03-21 21:27:15 +0100
committerJochen Dolze <vdr@dolze.de>2011-03-21 21:27:15 +0100
commit909f8f3af9261dd03780eb2bbe35239ed12ba3b2 (patch)
tree11aabb5068ac40e11125db68dd00649aa4eee23b
parent7bb7938a64f28fd69f9bd985b448083c7725896a (diff)
downloadvdr-plugin-xmltv2vdr-909f8f3af9261dd03780eb2bbe35239ed12ba3b2.tar.gz
vdr-plugin-xmltv2vdr-909f8f3af9261dd03780eb2bbe35239ed12ba3b2.tar.bz2
Fixed actor/other list bug (added more than once)
Added more debug info
-rw-r--r--parse.cpp38
-rw-r--r--parse.h4
-rw-r--r--xmltv2vdr.cpp17
3 files changed, 48 insertions, 11 deletions
diff --git a/parse.cpp b/parse.cpp
index afeb08a..15d6228 100644
--- a/parse.cpp
+++ b/parse.cpp
@@ -169,10 +169,12 @@ void cXMLTVEvent::Clear()
director=NULL;
}
year=0;
- vps= (time_t) 0;
starttime = 0;
duration = 0;
+ vps= (time_t) 0;
eventid=0;
+ actors.Clear();
+ others.Clear();
}
cXMLTVEvent::cXMLTVEvent()
@@ -182,8 +184,8 @@ cXMLTVEvent::cXMLTVEvent()
description=NULL;
country=NULL;
system=NULL;
- rating=NULL;
review=NULL;
+ rating=NULL;
origtitle=NULL;
director=NULL;
Clear();
@@ -765,19 +767,39 @@ bool cParse::Process(char *buffer, int bufsize)
if ((map->Flags() & OPT_APPEND)==OPT_APPEND) addevents=true;
cChannel *channel=Channels.GetByChannelID(map->ChannelIDs()[i]);
- cSchedule* schedule = (cSchedule *) schedules->GetSchedule(channel,addevents);
- if (schedule)
+ if (channel)
{
- cEvent *event=NULL;
- if ((event=SearchEvent(schedule,&xevent)))
+ cSchedule* schedule = (cSchedule *) schedules->GetSchedule(channel,addevents);
+ if (schedule)
{
- PutEvent(schedule,event,&xevent,map);
+ cEvent *event=NULL;
+ if ((event=SearchEvent(schedule,&xevent)))
+ {
+ PutEvent(schedule,event,&xevent,map);
+ }
+ else
+ {
+ if (addevents)
+ {
+ PutEvent(schedule,event,&xevent,map);
+ }
+ else
+ {
+ time_t start=xevent.StartTime();
+ esyslog("xmltv2vdr: cannot find existing event in epg.data for xmltv-event %s@%s",
+ xevent.Title(),ctime(&start));
+ }
+ }
}
else
{
- if (addevents) PutEvent(schedule,event,&xevent,map);
+ esyslog("xmltv2vdr: cannot get schedule for channel %s (no import)",channel->Name());
}
}
+ else
+ {
+ esyslog("xmltv2vdr: channel %s not found in channels.conf",*map->ChannelIDs()[i].ToString());
+ }
}
}
delete schedulesLock;
diff --git a/parse.h b/parse.h
index 5674ccd..3aea7be 100644
--- a/parse.h
+++ b/parse.h
@@ -22,10 +22,11 @@ private:
char *shorttext;
char *description;
char *country;
- char *review;
char *system;
+ char *review;
char *rating;
char *origtitle;
+ char *director;
int year;
time_t starttime;
int duration;
@@ -33,7 +34,6 @@ private:
tEventID eventid;
cStringList actors;
cStringList others;
- char *director;
#if VDRVERSNUM >= 10711
uchar parentalRating;
uchar contents[MaxEventContents];
diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp
index 2f821a7..9f7bf84 100644
--- a/xmltv2vdr.cpp
+++ b/xmltv2vdr.cpp
@@ -50,7 +50,22 @@ void cEPGExecutor::Action()
bool ret=false;
for (cEPGSource *epgs=sources->First(); epgs; epgs=sources->Next(epgs))
{
- if ((ret=epgs->Execute())) break; // TODO: check if we must execute second/third source!
+ int retries=0;
+ while (retries<2)
+ {
+ ret=epgs->Execute();
+ if (!ret)
+ {
+ dsyslog("xmltv2vdr: waiting 60 seconds (%i)",retries);
+ sleep(60);
+ retries++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ if (ret) break; // TODO: check if we must execute second/third source!
}
if (ret) cSchedules::Cleanup(true);
}