Always show option to download in the background immediately

This commit is contained in:
Jamie Cameron
2025-04-25 20:11:45 -07:00
parent bcfb698ac6
commit f17be6a383
2 changed files with 7 additions and 5 deletions

View File

@ -64,7 +64,7 @@ else {
$download{'gid'} = $uinfo[3];
}
}
if ($in{'bg'} && $can_schedule) {
if ($in{'bg'} == 1 && $can_schedule) {
# Validate time
$in{'hour'} =~ /^\d+$/ && $in{'min'} =~ /^\d+$/ &&
$in{'day'} =~ /^\d+$/ && $in{'year'} =~ /^\d+$/ ||
@ -111,7 +111,7 @@ if ($in{'bg'} && $can_background) {
&unlock_file($atjob_cmd);
&save_download(\%download);
if (!$can_schedule) {
if (!$can_schedule || $in{'bg'} == 2) {
# Just run this script right now
&execute_command("$atjob_cmd $download{'id'} &");
}

View File

@ -56,8 +56,10 @@ if ($can_download) {
# Download time can be selected, for scheduling with At
@now = localtime(time());
print &ui_table_row($text{'index_bg'},
&ui_radio("bg", 0, [ [ 0, $text{'index_bg0'}."<br>" ],
[ 1, $text{'index_bg1'} ] ])." ".
&ui_radio("bg", 0,
[ [ 0, $text{'index_bg0'}."<br>" ],
[ 2, $text{'index_bg1u'}."<br>" ],
[ 1, $text{'index_bg1'} ] ])." ".
&ui_textbox("day", $now[3], 2)."/".
&ui_select("month", $now[4],
[ map { [ $_, $text{"smonth_".($_+1)} ] }
@ -72,7 +74,7 @@ if ($can_download) {
# Download must be immediate, but can be backgrounded
print &ui_table_row($text{'index_bg'},
&ui_radio("bg", 0, [ [ 0, $text{'index_bg0'} ],
[ 1, $text{'index_bg1u'} ] ]));
[ 2, $text{'index_bg1u'} ] ]));
}
else {
# Download is always right now