diff options
-rw-r--r-- | epghandler.c | 26 | ||||
-rw-r--r-- | epghandler.h | 5 |
2 files changed, 29 insertions, 2 deletions
diff --git a/epghandler.c b/epghandler.c index 68f68d5..5bed74f 100644 --- a/epghandler.c +++ b/epghandler.c @@ -41,15 +41,25 @@ bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { LogD(1, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); - if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) + if (Event->ShortText() && !strcmp(Event->ShortText(),"")) + origShortText = Event->ShortText(); + else + origShortText.clear(); + + //if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) Event->SetShortText(ShortText); return true; } bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) { LogD(1, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); + + if (Event->Description() && !strcmp(Event->Description(),"")) + origDescription = Event->Description(); + else + origDescription.clear(); - if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) + //if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) Event->SetDescription(Description); return true; } @@ -81,6 +91,18 @@ bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { bool cEEpgHandler::HandleEvent(cEvent* Event) { //LogD(1, prep("HandleEvent")); + + //After FixEpgBugs of cEvent set the original Short Text if empty + if (!Event->ShortText() && !strcmp(Event->ShortText(),"")) + Event->SetShortText(origShortText.c_str()); + + //TODO just to see the difference + if (!origDescription.empty() && !origDescription.compare(Event->Description())) { + origDescription.append(" | EIT: "); + origDescription.append(Event->Description()); + Event->SetDescription(origDescription.c_str()); + } + return true; } diff --git a/epghandler.h b/epghandler.h index fd4911e..3256153 100644 --- a/epghandler.h +++ b/epghandler.h @@ -8,6 +8,7 @@ #ifndef CEEPGHANDLER_H_ #define CEEPGHANDLER_H_ #include <vdr/epg.h> +#include <string> class cEEpgHandler : public cEpgHandler { public: @@ -28,6 +29,10 @@ public: virtual bool HandleEvent(cEvent *Event); virtual bool SortSchedule(cSchedule *Schedule); virtual bool DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version); + +private: + std::string origShortText; + std::string origDescription; }; #endif /* CEEPGHANDLER_H_ */ |