Fix monitor counts and percentages displayed in main monitor pane

This commit is contained in:
DariusIII
2018-09-03 14:35:20 +02:00
parent 2fac6cc8ac
commit 363d1c545e
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -1,4 +1,5 @@
2018-09-03 DariusIII
* Fix: Fix monitor counts and percentages displayed in main monitor pane
* Chg: Update ReleaseRemover class
* Chg: Check for array before inserting audio data from mediainfo
* Chg: Add checks before inserting audio data from mediainfo
+4 -4
View File
@@ -113,8 +113,8 @@ while ($runVar['counts']['iterations'] > 0) {
echo ColorCLI::info("\nThe numbers(queries) above are currently being refreshed. \nNo pane(script) can be (re)started until these have completed.\n");
$timer02 = time();
$splitqry = $tRun->proc_query(4, null, null, $db_name);
$newOldqry = $tRun->proc_query(6, null, null, null);
$splitqry = $tRun->proc_query(4, null, $db_name);
$newOldqry = $tRun->proc_query(6, null, null);
$splitres = (array) array_first(DB::select($splitqry));
$runVar['timers']['newOld'] = (array) array_first(DB::select($newOldqry));
@@ -273,8 +273,8 @@ while ($runVar['counts']['iterations'] > 0) {
$runVar['counts']['diff'][$key] = number_format($proc - $runVar['counts']['start'][$key]);
//calculate percentages -- if user has no releases, set 0 for each key or this will fail on divide by zero
$runVar['counts']['percent'][$key] = ($runVar['counts']['now']['releases'] > 0
? sprintf('%02s', floor(($proc / $runVar['counts']['now']['releases']) * 100)) : 0);
$runVar['counts']['percent'][$key] = $runVar['counts']['now']['releases'] > 0
? sprintf('%02s', floor(($proc / $runVar['counts']['now']['releases']) * 100)) : 0;
}
$runVar['counts']['now']['total_work'] += $runVar['counts']['now']['work'];