fixed bugs introduced in last version

This commit is contained in:
huangjx
2022-02-21 22:12:04 +08:00
parent 40e9d93f61
commit 7cd9a05a72
6 changed files with 25 additions and 16 deletions

View File

@@ -1,17 +1,22 @@
<?php
extract($_);
$permission_error = sprintf("aria2 is installed but not executable.Please execute command sudo chmod 755 %s", $aria2_bin);
if ($youtube_installed && !$youtube_executable) {
$ytb_error = sprintf("youtube-dl is installed but not executable.Please execute command sudo chmod 755 %s", $youtube_bin);
} else if (!$youtube_installed && !$youtube_executable) {
$ytb_error = "youtube-dl is not installed!";
$errors = [];
if ($aria2_installed && !$aria2_executable) {
array_push($errors, sprintf("aria2 is installed but not executable.Please execute command sudo chmod 755 %s", $aria2_bin));
}
if ($youtube_installed && !$youtube_executable) {
array_push($errors, sprintf("youtube-dl is installed but not executable.Please execute command sudo chmod 755 %s", $youtube_bin));
} else if (!$youtube_installed) {
array_push($errors, "youtube-dl is not installed!");
}
?>
<div id="app-navigation">
<?php if ($ncd_hide_errors): ?>
<?php if (isset($ytb_error)): ?>
<div data-error-message="<?php print $l->t($ytb_error);?>"></div>
<?php endif;?>
<?php if (!$ncd_hide_errors): ?>
<?php foreach ($errors as $error): ?>
<div data-error-message="<?php print $l->t($error);?>"></div>
<?php endforeach;?>
<?php endif;?>
<div class="app-navigation-new" id="search-download" data-inputbox="form-input-wrapper">
@@ -27,7 +32,7 @@ if ($youtube_installed && !$youtube_executable) {
</button>
</button>
<?php elseif ($aria2_installed && !$aria2_executable): ?>
<button type="button" class="icon-power notinstalled" data-error-message="<?php print $l->t($permission_error);?>">
<button type="button" class="icon-power notinstalled" >
<?php print $l->t("aria2c is installed but not executable");?>
</button>
<?php else: ?>