Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Mar 1, 2024
1 parent a122505 commit 7459e22
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion view/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$obj->queue_size = 0;
$obj->concurrent = 1;
$obj->is_encoding = false;
$obj->is_downloading = false;
$obj->queue_list = array();
$obj->msg = "";
$obj->encoding = new stdClass();
Expand All @@ -24,6 +25,7 @@
}
$obj->encoding = Encoder::areEncoding();
$obj->downloaded = Encoder::areDownloaded();
$obj->downloading = Encoder::areDownloading();
$obj->transferring = Encoder::areTransferring();
//$obj->transferring = Encoder::isTransferring();
$obj->queue_list = Encoder::getAllQueue();
Expand All @@ -41,7 +43,6 @@
$msg = (count($obj->encoding) == 1) ? "The file " : "The files ";
for ($i = 0; $i < count($obj->encoding); $i++) {
$obj->encoding_status[$i] = Encoder::getVideoConversionStatus($obj->encoding[$i]['id']);
$obj->download_status[$i] = Encoder::getYoutubeDlProgress($obj->encoding[$i]['id']);
$msg .= "[{$obj->encoding[$i]['id']}] {$obj->encoding[$i]['filename']}";
if (count($obj->encoding) > 1 && $i < count($obj->encoding) - 1) {
$msg .= ", ";
Expand All @@ -51,6 +52,20 @@
$obj->msg = $msg;
}

if (!empty($obj->downloading)) {
$obj->is_downloading = true;
$msg = (count($obj->downloading) == 1) ? "The file " : "The files ";
for ($i = 0; $i < count($obj->encoding); $i++) {
$obj->download_status[$i] = Encoder::getYoutubeDlProgress($obj->downloading[$i]['id']);
$msg .= "[{$obj->encoding[$i]['id']}] {$obj->encoding[$i]['filename']}";
if (count($obj->downloading) > 1 && $i < count($obj->downloading) - 1) {
$msg .= ", ";
}
}
$msg .= (count($obj->encoding) == 1) ? " is downloading" : " are downloading";
$obj->msg = $msg;
}

if (!empty($_GET['serverStatus'])) {
require_once '../objects/ServerMonitor.php';
require_once '../objects/functions.php';
Expand Down

0 comments on commit 7459e22

Please sign in to comment.