From: b Date: Mon, 9 Oct 2023 21:44:00 +0000 (+0000) Subject: bugfix viewer after review X-Git-Tag: v1.1.0~32 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=1c268177ffd6c7c3a188028fb5728bb22db0b775;p=ott%2Fbsta bugfix viewer after review --- diff --git a/botm-common b/botm-common index c88ca49..373116e 160000 --- a/botm-common +++ b/botm-common @@ -1 +1 @@ -Subproject commit c88ca49b964a50d81875ab64ccaf2f25c64b89f3 +Subproject commit 373116e970d4474d1154fdde9e9d0a033acd27e9 diff --git a/bsta_lib.1.pm b/bsta_lib.1.pm index 42c700e..720cd7c 100644 --- a/bsta_lib.1.pm +++ b/bsta_lib.1.pm @@ -858,7 +858,7 @@ sub print_viewer_page { my $next_available = ($password_ok || ($next_frame <= $last_frame)); my $prefetch_next = ( $password_ok || - ($next_frame < $last_frame) || ( + ($next_frame < $last_frame) || ( # avoid unseen trigger! ($next_frame <= $last_frame) && ($ong_state >= STATE->{'ready'}) ) @@ -877,14 +877,14 @@ sub print_viewer_page { ) ); my $show_command_link = ($next_available || (!$access)); - my $show_command_cursor = (($frame == $last_frame) || ($command eq '')); + my $show_command_cursor = ((!$next_available) || ($command eq '')); my $frame_indirect = !( (!$access) || ( ($frame <= $last_frame) && ($ong_state > STATE->{'inactive'}) ) ); - my $nextframe_indirect = !($next_frame < $last_frame); + my $nextframe_indirect = !($next_frame <= $last_frame); my $password_query; @@ -934,7 +934,7 @@ sub print_viewer_page { }} ); } - my $frame_file = ''; + my $frame_file; my $frame_url; my $frame_next_url; my $frame_normal_url; @@ -982,14 +982,14 @@ sub print_viewer_page { if ($password_ok) { $password_query = url_query_encode({'p', $settings->{'password'}}); - $goto_url = merge_url($goto_url , {'query' => $password_query}); - $info_url = merge_url($info_url , {'query' => $password_query}); - $bbcode_url = merge_url($bbcode_url , {'query' => $password_query}); - $viewer_url = merge_url($viewer_url , {'query' => $password_query}); - $viewer_0_url = merge_url($viewer_0_url , {'query' => $password_query}); - $viewer_prev_url = merge_url($viewer_prev_url, {'query' => $password_query}); - $viewer_next_url = merge_url($viewer_next_url, {'query' => $password_query}); - $viewer_last_url = merge_url($viewer_last_url, {'query' => $password_query}); + $goto_url = merge_url($goto_url , {'query' => $password_query, 'append_query' => 1}); + $info_url = merge_url($info_url , {'query' => $password_query, 'append_query' => 1}); + $bbcode_url = merge_url($bbcode_url , {'query' => $password_query, 'append_query' => 1}); + $viewer_url = merge_url($viewer_url , {'query' => $password_query, 'append_query' => 1}); + $viewer_0_url = merge_url($viewer_0_url , {'query' => $password_query, 'append_query' => 1}); + $viewer_prev_url = merge_url($viewer_prev_url, {'query' => $password_query, 'append_query' => 1}); + $viewer_next_url = merge_url($viewer_next_url, {'query' => $password_query, 'append_query' => 1}); + $viewer_last_url = merge_url($viewer_last_url, {'query' => $password_query, 'append_query' => 1}); if ($frame_indirect) { $frame_url = merge_url($frame_url , {'query' => $password_query}); } @@ -1024,6 +1024,8 @@ sub print_viewer_page { } } + # everything determined, now start generating + if (ref($file)) { $fh=$file; unless (seek($fh, 0, 0)) { diff --git a/viewer.1.pl b/viewer.1.pl index 91d5d5c..5815ef1 100644 --- a/viewer.1.pl +++ b/viewer.1.pl @@ -146,8 +146,8 @@ if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) { my %new_state = %state; unless ( ($state{'ip1'} eq $IP) || - ($state{'ip1'} eq $IP) || - ($state{'ip1'} eq $IP) + ($state{'ip2'} eq $IP) || + ($state{'ip3'} eq $IP) ) { if ($state{'ip1'} eq '') {