summaryrefslogtreecommitdiff
path: root/pages/schedule.ecpp
diff options
context:
space:
mode:
Diffstat (limited to 'pages/schedule.ecpp')
-rw-r--r--pages/schedule.ecpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp
index 8a77059..5d14e2b 100644
--- a/pages/schedule.ecpp
+++ b/pages/schedule.ecpp
@@ -31,29 +31,50 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<%cpp>
pageTitle = trVDR("Schedule");
+#if VDRVERSNUM >= 20301
+ LOCK_SCHEDULES_READ;
+ LOCK_CHANNELS_READ;
+#else
cSchedulesLock schedulesLock;
cSchedules const* schedules = cSchedules::Schedules( schedulesLock );
ReadLock channelsLock( Channels );
if ( !channelsLock )
throw HtmlError( tr("Couldn't aquire access to channels, please try again later.") );
+#endif
// cChannel* Channel; (see %request above)
if ( channel > 0 ) {
+#if VDRVERSNUM >= 20301
+ Channel = (cChannel *)Channels->GetByNumber( channel );
+#else
Channel = Channels.GetByNumber( channel );
+#endif
}
else {
if (cDevice::CurrentChannel()) {
+#if VDRVERSNUM >= 20301
+ Channel = (cChannel *)Channels->GetByNumber(cDevice::CurrentChannel());
+#else
Channel = Channels.GetByNumber(cDevice::CurrentChannel());
+#endif
}
else {
+#if VDRVERSNUM >= 20301
+ Channel = (cChannel *)Channels->Get( Channels->GetNextNormal( -1 ) );
+#else
Channel = Channels.Get( Channels.GetNextNormal( -1 ) );
+#endif
}
}
if ( Channel == 0 )
throw HtmlError( tr("Couldn't find channel or no channels available. Maybe you mistyped your request?") );
+#if VDRVERSNUM >= 20301
+ cSchedule const* Schedule = Schedules->GetSchedule( (const cChannel *)Channel );
+#else
cSchedule const* Schedule = schedules->GetSchedule( Channel );
+#endif
</%cpp>
<& pageelems.doc_type &>
<html>
@@ -81,7 +102,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
time_t now = time(NULL) - ::Setup.EPGLinger * 60;
// tChannelID channel_id(Channel->GetChannelID());
// int evntNr = 0;
+#if VDRVERSNUM >= 20301
+ for (const cEvent *Event = (cEvent *)Schedule->Events()->First(); Event; Event = (cEvent *)Schedule->Events()->Next(Event)) {
+#else
for (const cEvent *Event = Schedule->Events()->First(); Event; Event = Schedule->Events()->Next(Event)) {
+#endif
if (Event->EndTime() <= now && Event != PresentEvent)
continue;
@@ -99,7 +124,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
bool truncated = false;
bool lastEventCurrentDay = false;
{
+#if VDRVERSNUM >= 20301
+ cEvent* NextEvent = (cEvent *)Schedule->Events()->Next(Event);
+#else
cEvent* NextEvent = Schedule->Events()->Next(Event);
+#endif
if (!NextEvent) {
lastEventCurrentDay = true;
}