summaryrefslogtreecommitdiff
path: root/epghandler.c
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-05-13 18:20:18 +0200
committerDimitar Petrovski <dimeptr@gmail.com>2012-05-18 09:20:36 +0200
commit23260abbe50c8315663b4f63fdaed38c26372a29 (patch)
tree28256c2dad6211006ad80c2999c36b018ad64f0d /epghandler.c
parent68eb397f7d419c4caf58220b62de22ac3244d682 (diff)
downloadvdr-plugin-eepg-23260abbe50c8315663b4f63fdaed38c26372a29.tar.gz
vdr-plugin-eepg-23260abbe50c8315663b4f63fdaed38c26372a29.tar.bz2
corected epghandler
Diffstat (limited to 'epghandler.c')
-rw-r--r--epghandler.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/epghandler.c b/epghandler.c
index 5bed74f..2c25268 100644
--- a/epghandler.c
+++ b/epghandler.c
@@ -10,7 +10,7 @@
cEEpgHandler::cEEpgHandler() {
// TODO Auto-generated constructor stub
- LogD(1, prep("cEEpgHandler()"));
+ LogD(4, prep("cEEpgHandler()"));
}
@@ -31,7 +31,7 @@ bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) {
}
bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) {
- LogD(1, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title);
+ LogD(3, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title);
if (!Event->Title() || Title && (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title))))
Event->SetTitle(Title);
@@ -39,12 +39,14 @@ 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);
+ LogD(3, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText);
- if (Event->ShortText() && !strcmp(Event->ShortText(),""))
- origShortText = Event->ShortText();
- else
+ if (Event->ShortText() && strcmp(Event->ShortText(),"") != 0) {
+ origShortText = std::string(Event->ShortText());
+ }
+ else {
origShortText.clear();
+ }
//if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText))))
Event->SetShortText(ShortText);
@@ -52,9 +54,9 @@ bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) {
}
bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) {
- LogD(1, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description);
+ LogD(3, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description);
- if (Event->Description() && !strcmp(Event->Description(),""))
+ if (Event->Description() && strcmp(Event->Description(),"") != 0)
origDescription = Event->Description();
else
origDescription.clear();
@@ -90,18 +92,22 @@ 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());
- }
+
+ LogD(3, prep("HandleEvent st:%s ost:%s desc:%s odesc:%s"),Event->ShortText(),origShortText.c_str(),Event->Description(),origDescription.c_str());
+
+ //After FixEpgBugs of cEvent set the original Short Text if empty
+ if (!Event->ShortText() || !strcmp(Event->ShortText(),""))
+ Event->SetShortText(origShortText.c_str());
+
+ if (!Event->Description() && !origDescription.empty()) {
+ Event->SetDescription(origDescription.c_str());
+ }
+ //TODO just to see the difference
+ //else if (!origDescription.empty() && !origDescription.compare(Event->Description())) {
+// origDescription.append(" | EIT: ");
+// origDescription.append(Event->Description());
+// Event->SetDescription(origDescription.c_str());
+ // }
return true;
}