summaryrefslogtreecommitdiff
path: root/epghandler.c
diff options
context:
space:
mode:
Diffstat (limited to 'epghandler.c')
-rw-r--r--epghandler.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/epghandler.c b/epghandler.c
index 44ee909..0262d75 100644
--- a/epghandler.c
+++ b/epghandler.c
@@ -9,7 +9,9 @@
#if APIVERSNUM > 10725
#include "log.h"
#include "equivhandler.h"
+#include "eit2.h"
#include <vdr/sources.h>
+#include <libsi/si.h>
cEEpgHandler::cEEpgHandler() {
LogD(4, prep("cEEpgHandler()"));
@@ -27,8 +29,11 @@ bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule,
//DISH NID 0x1001 to 0x100B BEV 0x100 and 0x101
//TODO move the eit handling code at least for NA providers here instead of discarding.
int nid = Schedule->ChannelID().Nid();
- if ((nid >= 0x1001 && nid <= 0x100B) || nid == 0x101 || nid == 0x100)
+ if ((nid >= 0x1001 && nid <= 0x100B) || nid == 0x101 || nid == 0x100) {
+ SI::cEIT2 eit2(Schedule);
+ eit2.ProcessEitEvent(Schedule, EitEvent, TableID, Version);
return true;
+ }
//TODO Should it be added in setup?
if (EitEvent->getDurationHour() > _LONG_EVENT_HOURS) {
@@ -43,6 +48,25 @@ bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule,
}
}
+ //VDR creates new event if the EitEvent StartTime is different than EEPG time so
+ //the EEPG event has to be deleted but the data should be kept
+ const cEvent* ev = Schedule->GetEvent(EitEvent->getEventId(),EitEvent->getStartTime());
+ if (!ev){
+ ev = Schedule->GetEvent(EitEvent->getEventId());
+ if (ev && ((ev->StartTime()>EitEvent->getStartTime() && ev->StartTime()<=EitEvent->getStartTime()+EitEvent->getDuration())
+ || (EitEvent->getStartTime() > ev->StartTime() && EitEvent->getStartTime() <= ev->EndTime()))) {
+ LogD(0, prep("!!!Deleting Event id:%d title:%s start_time:%d new_start_time:%d duration:%d new_duration:%d"), ev->EventID(), ev->Title(), ev->StartTime(), EitEvent->getStartTime(), ev->Duration(), EitEvent->getDuration());
+
+ if (ev->Description() && strcmp(ev->Description(),"") != 0)
+ origDescription = ev->Description();
+ if (ev->ShortText() && strcmp(ev->ShortText(),"") != 0)
+ origShortText = ev->ShortText();
+ Schedule->DropOutdated(ev->StartTime()-1,ev->EndTime()+1,ev->TableID()-1,ev->Version());
+ LogD(0, prep("!!!End Deleting Event"));
+ }
+ }
+
+
return false;
// return true;
@@ -148,6 +172,7 @@ bool cEEpgHandler::HandleEvent(cEvent* Event) {
return true;
}
+
bool cEEpgHandler::SortSchedule(cSchedule* Schedule) {
Schedule->Sort();