summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-05-16 07:03:48 +0200
committerJochen Dolze <vdr@dolze.de>2012-05-16 07:03:48 +0200
commitb1905747a381ef8c5c198c82f8ae9c5ce63f41b7 (patch)
tree0c6cbbb5aa59ac5a9977041ebc92d23c3680f21d
parenta55e6ea41ce0498c87ae01a0856549c2eabc9a48 (diff)
downloadvdr-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.cpp22
-rw-r--r--setup.h1
2 files changed, 12 insertions, 11 deletions
diff --git a/import.cpp b/import.cpp
index f1f4f7f..90a6dc9 100644
--- a/import.cpp
+++ b/import.cpp
@@ -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)
diff --git a/setup.h b/setup.h
index 716d26d..2cff749 100644
--- a/setup.h
+++ b/setup.h
@@ -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);