summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDime <dime@dime-dell-system-xps-l702x.ein-sof.net.mk>2012-05-13 13:31:03 +0200
committerDimitar Petrovski <dimeptr@gmail.com>2012-05-18 09:20:35 +0200
commit68eb397f7d419c4caf58220b62de22ac3244d682 (patch)
treea4854dcd9a850964c1d6b62c1dbe827fab585181
parent4a30d62b0614e2a2af4b862e9ab5c5c471c8d5a5 (diff)
downloadvdr-plugin-eepg-68eb397f7d419c4caf58220b62de22ac3244d682.tar.gz
vdr-plugin-eepg-68eb397f7d419c4caf58220b62de22ac3244d682.tar.bz2
use the original eepg Short Text and Description if missing in EIT
-rw-r--r--epghandler.c26
-rw-r--r--epghandler.h5
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_ */