]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - viewer.1.pl
continued bugfix of 2words & index & launch
[ott/bsta] / viewer.1.pl
index 9205be6ddab2a9227aaea22991ad98153b6db3da..7eb559c189b35423b4e4b38c3800fd9dfa395414 100644 (file)
@@ -176,6 +176,8 @@ if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
                        my $frame_file;
                        my $in_path;
                        my $out_path;
+                       my $ext;
+                       my $ong_time = int($settings{'firstongtime'});
                        
                        %story     = read_data_file(DATA_STORY_PATH());
                        %goto_list = read_data_file(DATA_LIST_PATH);
@@ -188,6 +190,7 @@ if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
                                
                                # update ONG time of frame 1
                                $frame_data{'ongtime'} = $time;
+                               $frame_data{'timer'} = $ong_time;
                                write_data_file($frame_data_path, '', '', \%frame_data);
                                
                                # set initial state
@@ -197,15 +200,15 @@ if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
                                $state{'ip2'}   = '0.0.0.0';
                                $state{'ip3'}   = '';
                                $state{'nextong'} = (int($time / 3600) + int($settings{'firstongtime'})) * 3600 ;
-                               $state{'ongtime'} = int($settings{'firstongtime'});
+                               $state{'ongtime'} = $ong_time;
                                
                                # prepare to ONG frame 1
                                
                                # determine frame file & paths
-                               unless (defined($frame_data{'ext'})){
-                                       $frame_data{'ext'} = $default{'ext'};
-                               }
-                               $frame_file = sprintf($settings{'frame'}, $frame, $frame_data{'ext'});
+                               $ext = (defined($frame_data{'ext'})) ?
+                                       $frame_data{'ext'} :
+                                       $default{'ext'};
+                               $frame_file = sprintf($settings{'frame'}, $frame, $ext);
                                $in_path  = join_path(PATH_SEPARATOR(), DATA_PATH(), $frame_file);
                                $out_path = join_path(PATH_SEPARATOR(), WWW_PATH(),  $frame_file);