From 21dce4ff58c6e1da3691a874ca03cf77c696cda4 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Wed, 13 Jun 2007 20:47:04 +0000 Subject: - Select current channel in schedules, if no channel is given. Fixes #308 --- pages/schedule.ecpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'pages') 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 #include #include +#include #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?") ); -- cgit v1.2.3