From 3cf762e06f46d1f69e06030b95ffaed3b951b46d Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Thu, 14 Jun 2007 20:45:47 +0000 Subject: - Infobox status update state is remembered in session. Fixes #313 --- pages/ibox.ecpp | 12 ++++++++---- pages/pageelems.ecpp | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'pages') diff --git a/pages/ibox.ecpp b/pages/ibox.ecpp index 666ebc2..4d819f5 100644 --- a/pages/ibox.ecpp +++ b/pages/ibox.ecpp @@ -21,6 +21,7 @@ using namespace std; <%session scope="global"> bool logged_in(false); +int update_status(1); <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); @@ -30,6 +31,9 @@ bool logged_in(false); tChannelID next_chan; reply.setContentType( "application/xml" ); + if (update_status != update) { + update_status = update; + } #if VDRVERSNUM >= 10403 const char* NowReplaying = cReplayControl::NowReplaying(); #else @@ -134,22 +138,22 @@ bool logged_in(false); if (prev_chan.Valid() && next_chan.Valid()) { -<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) next_chan=(next_chan) &> +<& xmlresponse.ibox update=(update_status) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) next_chan=(next_chan) &> <%cpp> } else if (prev_chan.Valid()) { -<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) &> +<& xmlresponse.ibox update=(update_status) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) &> <%cpp> } else if (next_chan.Valid()) { -<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) next_chan=(next_chan) &> +<& xmlresponse.ibox update=(update_status) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) next_chan=(next_chan) &> <%cpp> } else { -<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) &> +<& xmlresponse.ibox update=(update_status) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) &> <%cpp> } break; diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index b6f4f8d..093255a 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -13,6 +13,9 @@ using namespace std; using namespace vdrlive; +<%session scope="global"> +int update_status(1); + <# ---------------------------------------------------------------------- #> @@ -82,7 +85,7 @@ using namespace vdrlive; <# ---------------------------------------------------------------------- #> <%def infobox_start_update> -<%cpp> { LiveStatusRequest('ibox.xml', 'infobox')<%cpp> } +<%cpp> { LiveStatusRequest('ibox.xml', 'infobox', <%cpp> if (update_status) { reply.sout() << "true"; } else { reply.sout() << "false"; } )<%cpp> } <# ---------------------------------------------------------------------- #> -- cgit v1.2.3