summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-06-13 20:47:04 +0000
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-06-13 20:47:04 +0000
commit21dce4ff58c6e1da3691a874ca03cf77c696cda4 (patch)
tree08b5abceed094ac38f1364c971ff088051bfd41b
parent886ec2ba42b20ffef54971aea153afd7d610ade6 (diff)
downloadvdr-plugin-live-21dce4ff58c6e1da3691a874ca03cf77c696cda4.tar.gz
vdr-plugin-live-21dce4ff58c6e1da3691a874ca03cf77c696cda4.tar.bz2
- Select current channel in schedules, if no channel is given.
Fixes #308
-rw-r--r--doc/ChangeLog6
-rw-r--r--pages/schedule.ecpp15
2 files changed, 17 insertions, 4 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 2576af5..13bb80a 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-13 Dieter Hametner <dh+vdr at gekrumbel dot de>
+
+ * pages/schedule.ecpp: If no channel is given, and a current
+ channel is know to vdr select it when calling the schedule page
+ in live.
+
2007-06-12 Dieter Hametner <dh+vdr at gekrumbel dot de>
Added orange-blue theme as an example of a theme with dark
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp
index b2faf89..ef03fdf 100644
--- a/pages/schedule.ecpp
+++ b/pages/schedule.ecpp
@@ -3,6 +3,7 @@
#include <vdr/channels.h>
#include <vdr/epg.h>
#include <vdr/config.h>
+#include <vdr/device.h>
#include "exception.h"
#include "livefeatures.h"
#include "setup.h"
@@ -37,11 +38,17 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
throw HtmlError( tr("Couldn't aquire access to channels, please try again later.") );
// cChannel* Channel; (see %request above)
- if ( channel > 0 )
+ if ( channel > 0 ) {
Channel = Channels.GetByNumber( channel );
- else
- Channel = Channels.Get( Channels.GetNextNormal( -1 ) );
-
+ }
+ else {
+ if (cDevice::CurrentChannel()) {
+ Channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ }
+ else {
+ Channel = Channels.Get( Channels.GetNextNormal( -1 ) );
+ }
+ }
if ( Channel == 0 )
throw HtmlError( tr("Couldn't find channel or no channels available. Maybe you mistyped your request?") );