summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY7
-rw-r--r--i18n.c8
-rw-r--r--tvtv.c6
-rw-r--r--update.c51
4 files changed, 59 insertions, 13 deletions
diff --git a/HISTORY b/HISTORY
index 85dcc50..0f26fea 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,7 +1,7 @@
VDR Plugin 'tvtv' Revision History
-----------------------------------
-2008-06-08: Version 0.3.3ff
+2008-10-28: Version 0.3.3p6
- Minor change to be compatible to 1.6.0
- Fix segfault after manual update
- The time shift bugfix is now extended, option "auto" detects current
@@ -11,6 +11,11 @@ VDR Plugin 'tvtv' Revision History
Format can be included now (thx to monty35)
Note: existing timers would not be updated after a change (needs to be
impemented)!
+- Add autofix of buggy received timezone offset (thx to monty35)
+ TVTV transmit still +0200 for CET times (20081028)
+- Do not readd outdated timers (thx to monty35)
+ TVTV still transmit outdated timers, which otherwise would be added
+ by plugin and shortly deleted by vdr
2007-02-06: Version 0.3.3
- The plugin needed to be restarted if username or password were changed
diff --git a/i18n.c b/i18n.c
index 843530f..0dcf6db 100644
--- a/i18n.c
+++ b/i18n.c
@@ -441,8 +441,8 @@ const tI18nPhrase Phrases[] = {
#endif
#endif
},
- { "Time shift bugfix", // English
- "\"Zeitproblem\"-Fix aktivieren", // Deutsch
+ { "Timer update time shift bugfix", // English
+ "Timer Update Zeitverschiebung-Fix aktivieren", // Deutsch
"", // Slovenski
"", // Italiano
"", // Nederlands
@@ -470,8 +470,8 @@ const tI18nPhrase Phrases[] = {
#endif
#endif
},
- { " Time shift (hrs)", // English
- " Zeitverschiebung (Std)", // Deutsch
+ { " Time shift check (hrs)", // English
+ " Zeitverschiebung Check (Std)", // Deutsch
"", // Slovenski
"", // Italiano
"", // Nederlands
diff --git a/tvtv.c b/tvtv.c
index ac2d832..aa4263d 100644
--- a/tvtv.c
+++ b/tvtv.c
@@ -10,7 +10,7 @@
#include "update.h"
-static const char *VERSION = "0.3.3p4";
+static const char *VERSION = "0.3.3p6";
static const char *DESCRIPTION = "TVTV Timers update";
static const char *MAINMENUENTRY = "TVTV";
@@ -100,9 +100,9 @@ void cMenuSetupTVTV::Setup(void) {
Add(new cMenuEditBoolItem( tr("Use TVTV description in info.vdr"), &data.usetvtvdescr));
#endif
- Add(new cMenuEditStraItem( tr("Time shift bugfix"), &data.tvtv_bugfix, eTimeShiftBugfixMAX, timeshiftbugfixmodes));
+ Add(new cMenuEditStraItem( tr("Timer update time shift bugfix"), &data.tvtv_bugfix, eTimeShiftBugfixMAX, timeshiftbugfixmodes));
if (data.tvtv_bugfix == eTimeShiftBugfixManual)
- Add(new cMenuEditIntItem( tr(" Time shift (hrs)"), &data.tvtv_bugfix_hrs, -23, 23));
+ Add(new cMenuEditIntItem( tr(" Time shift check (hrs)"), &data.tvtv_bugfix_hrs, -23, 23));
Add(new cOsdItem(tr("Reload ChannelMap"),osUser9));
diff --git a/update.c b/update.c
index e63f7d3..97f4c3f 100644
--- a/update.c
+++ b/update.c
@@ -397,7 +397,7 @@ void cUpdate::ProcessImportedFile(const char *sBuffer)
unsigned int max_desc_len=0;
#endif
- time_t tStartTime, tVpsTime, tEndTime;
+ time_t tStartTime, tVpsTime, tEndTime, tCurrentTime;
struct tm tStart, tVps, tEnd;
int StartTZ, VpsTZ, EndTZ;
@@ -478,6 +478,7 @@ void cUpdate::ProcessImportedFile(const char *sBuffer)
tStartTime = timegm(&tStart);
tVpsTime = timegm(&tVps);
tEndTime = timegm(&tEnd);
+ time(&tCurrentTime); /* current time */
// VPS was introduced with VDR 1.3.5
#if VDRVERSNUM >= 10305
@@ -486,10 +487,31 @@ void cUpdate::ProcessImportedFile(const char *sBuffer)
vps = false;
#endif
+ // fix buggy received timezones
+ timelocal = localtime(&tStartTime);
+ if (timelocal->tm_gmtoff / 36 != StartTZ) {
+ dsyslog("TVTV: buggy timezone in tSTartTime detected: %+04d, fix to: %+04d", StartTZ, (int) (timelocal->tm_gmtoff / 36));
+ StartTZ = timelocal->tm_gmtoff / 36;
+ };
+
+ timelocal = localtime(&tEndTime);
+ if (timelocal->tm_gmtoff / 36 != EndTZ) {
+ dsyslog("TVTV: buggy timezone in tEndTime detected: %+04d, fix to: %+04d", EndTZ, (int) (timelocal->tm_gmtoff / 36));
+ EndTZ = timelocal->tm_gmtoff / 36;
+ };
+
tStartTime -= StartTZ*36;
- tEndTime -= EndTZ*36;
- if (vps) tVpsTime -= VpsTZ*36;
+ tEndTime -= EndTZ*36;
+ if (vps) {
+ timelocal = localtime(&tVpsTime);
+ if (timelocal->tm_gmtoff / 36 != VpsTZ) {
+ dsyslog("TVTV: buggy timezone in tVpsTime detected: %+04d, fix to: %+04d", VpsTZ, (int) (timelocal->tm_gmtoff / 36));
+ VpsTZ = timelocal->tm_gmtoff / 36;
+ };
+ tVpsTime -= VpsTZ*36;
+ };
+
tStartTime -= Setup.MarginStart * 60;
if (!vps) tEndTime += Setup.MarginStop * 60;
localtime_r(&tStartTime, &tStart);
@@ -698,8 +720,26 @@ void cUpdate::ProcessImportedFile(const char *sBuffer)
}
} else { // if (timer_update)
if (tvtv_timer[DEF_TVTV_SCHEDULE_ACT] == "rec") {
- Timers.Add(oTimer);
- isyslog("TVTV: timer %d added (%s) [%s/%s/%d/%04d-%04d/%s]", oTimer->Index() + 1,
+
+ if ((tEndTime < tCurrentTime) && (vps == false)) {
+ // Do not add timer entry in the past, if vps is not active
+ isyslog("TVTV: timer NOT added (EndTime in the past) (%s) [%s/%s/%d/%04d-%04d/%s]",
+ oTimer->File(),
+ tvtv_timer[DEF_TVTV_SCHEDULE_UID].c_str(),
+ tvtv_timer[DEF_TVTV_SCHEDULE_CHN].c_str(),
+ vps ? (tVps.tm_mday):(tStart.tm_mday),
+ vps ? (tVps.tm_hour * 100 + tVps.tm_min):(tStart.tm_hour * 100 + tStart.tm_min),
+ tEnd.tm_hour * 100 + tEnd.tm_min,
+ vps ? "VPS":"-");
+ } else { // if (tEndTime < tCurrentTime)
+
+ Timers.Add(oTimer);
+
+ if (tStartTime < tCurrentTime) {
+ isyslog("TVTV: timer %d notice: StartTime is behind CurrentTime", oTimer->Index() + 1);
+ }
+
+ isyslog("TVTV: timer %d added (%s) [%s/%s/%d/%04d-%04d/%s]", oTimer->Index() + 1,
oTimer->File(),
tvtv_timer[DEF_TVTV_SCHEDULE_UID].c_str(),
tvtv_timer[DEF_TVTV_SCHEDULE_CHN].c_str(),
@@ -707,6 +747,7 @@ void cUpdate::ProcessImportedFile(const char *sBuffer)
vps ? (tVps.tm_hour * 100 + tVps.tm_min):(tStart.tm_hour * 100 + tStart.tm_min),
tEnd.tm_hour * 100 + tEnd.tm_min,
vps ? "VPS":"-");
+ } // if (tEndTime < tCurrentTime)
}
}