diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-05-16 07:03:48 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-05-16 07:03:48 +0200 |
commit | b1905747a381ef8c5c198c82f8ae9c5ce63f41b7 (patch) | |
tree | 0c6cbbb5aa59ac5a9977041ebc92d23c3680f21d | |
parent | a55e6ea41ce0498c87ae01a0856549c2eabc9a48 (diff) | |
download | vdr-plugin-xmltv2vdr-b1905747a381ef8c5c198c82f8ae9c5ce63f41b7.tar.gz vdr-plugin-xmltv2vdr-b1905747a381ef8c5c198c82f8ae9c5ce63f41b7.tar.bz2 |
Changed import handling for 'create', existing eventids will be reassigned
Added picture linking for 'create'
-rw-r--r-- | import.cpp | 22 | ||||
-rw-r--r-- | setup.h | 1 |
2 files changed, 12 insertions, 11 deletions
@@ -347,7 +347,7 @@ void cImport::LinkPictures(const char *Source, cXMLTVStringList *Pics, tEventID } } } - + if (stat(dst,&statbuf)==-1) { if (symlink(src,dst)==-1) @@ -372,7 +372,7 @@ void cImport::LinkPictures(const char *Source, cXMLTVStringList *Pics, tEventID tsyslog("linked %s to %s_%i_%i.%s",pic,*ChanID.ToString(),DestID,i,ext); } } - } + } } } } @@ -510,6 +510,11 @@ bool cImport::PutEvent(cEPGSource *Source, sqlite3 *Db, cSchedule* Schedule, Event->SetTableID(0); Schedule->AddEvent(Event); Schedule->Sort(); + if (xEvent->Pics()->Size() && Source->UsePics()) + { + /* here's a good place to link pictures! */ + LinkPictures(xEvent->Source(),xEvent->Pics(),Event->EventID(),Event->ChannelID()); + } if (Source->Trace()) { localtime_r(&start,&tm); @@ -520,10 +525,6 @@ bool cImport::PutEvent(cEPGSource *Source, sqlite3 *Db, cSchedule* Schedule, } retcode=true; } - else - { - append=false; - } if (!Event) return false; @@ -1443,10 +1444,11 @@ int cImport::Process(cEPGSource *Source, cEPGExecutor &myExecutor) if (addevents && event && (event->EventID() != xevent.EventID())) { - esyslogs(Source,"found another event with different eventid"); - int newflags=map->Flags(); - newflags &=~OPT_APPEND; - map->ChangeFlags(newflags); + xevent.SetEITEventID(event->EventID()); // that's only a guess! + tsyslogs(Source,"{%5i} changing existing eventid to {%5i}",event->EventID(),xevent.EventID()); + event->SetEventID(xevent.EventID()); + event->SetVersion(0); + event->SetTableID(0); } #if VDRVERSNUM < 10726 && (!EPGHANDLER) @@ -135,7 +135,6 @@ private: uint flags; void output(void); cString title; - //const char *channel; cOsdItem *option(const char *s, bool yesno); void epgmappingreplace(cEPGMapping *newmapping); void Store(cEPGMapping *newmapping, bool replacemapping=true); |