Project

General

Profile

Actions

Bug #2498

open

[Patch] Mutischedule: incoplete time axis when ScheduleDuration != 8

Added by Anonymous about 7 years ago. Updated over 6 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/08/2017
Due date:
% Done:

0%

Estimated time:

Description

When ScheduleDuration is set to a value less than 8 hours the multischedule page can no longer access the entire time line. This is because the 8h steps is hard coded to multischedule.ecpp.

The following patch resolves the issue:

diff --git a/pages/multischedule.ecpp b/pages/multischedule.ecpp
index d4fca9d..0a80024 100644
--- a/pages/multischedule.ecpp
+++ b/pages/multischedule.ecpp
@ -193,10 +193,20 @ std::vector<time_t> times_start;
tm_r.tm_sec=0;
time_t midnight = mktime( &tm_r );

- // add four 8h steps per day to the time list
- for (int i=0; i<4*MAX_DAYS ; i++ )
+ // add steps to the time list
+ time_t max_hours;
+ try {
+ max_hours = lexical_cast<time_t>( LiveSetup().GetScheduleDuration() );
+ }
+ catch ( const bad_lexical_cast & )
+ {
+ esyslog("Live: could not convert '%s' into a schedule duration", LiveSe$
+ max_hours = 8;
+ };

for (int i=0; i<24*MAX_DAYS/max_hours ; i++ ) {
- times_start.push_back( midnight + MAX_HOURS*3600*i );
+ times_start.push_back( midnight + max_hours*3600*i );
}
vector< string > parts = StringSplit( LiveSetup().GetTimes(), ';' );
vector< time_t > offsets;

Actions #1

Updated by jasminj almost 7 years ago

  • Status changed from New to Feedback

I tried your patch, but I can't see a difference here.
Please explain more detailed what you would like to be changed and if possible add a patch for the latest version (see git).

BR,
Jasmin

Actions #2

Updated by maazl over 6 years ago

The patch changes the time stamps in the drop down list in the way that their distance matches the scheduleDuration setting. I.e. if you enter 6h you will get 0:00, 6:00, 12:00, 18:00 for each day, while with the default setting it is 0:00, 8:00, 16:00.

Newer version seem to include the manual values of the times setting as well. Of course, there is no difference regarding these values.

Btw. the patch merged flawlessly with the recent git head and AFAICS it still works as expected.
But there is a build break regarding tntnet. Some include files were missing. Fixed by:

diff --git a/tntconfig.cpp b/tntconfig.cpp
index 6d4c6e9..784014a 100644
--- a/tntconfig.cpp
+++ b/tntconfig.cpp
@@ -11,6 +11,10 @@
 #else
 #include <cxxtools/loginit.h>
 #endif
+#if !TNT_GLOBAL_TNTCONFIG
+#include <tnt/sessionscope.h>
+#include <tnt/httpreply.h>
+#endif

 namespace vdrlive {

Actions

Also available in: Atom PDF