diff --git a/session.inc.php b/session.inc.php index 0cb663a..77ea9f5 100644 --- a/session.inc.php +++ b/session.inc.php @@ -93,7 +93,8 @@ class Session function getTitle() : string { - return "Session ({$this->id}) '{$this->name}' (devices:".sizeof($this->getDevices())." ?:".sizeof($this->ignored_devices) . + $finished_plans = $this->countFinishedPlans(); + return "Session ({$this->id}) '{$this->name}' (plans:$finished_plans/".sizeof($this->plans)." devices:".sizeof($this->getDevices())." ?:".sizeof($this->ignored_devices) . ') (' . round($this->getDuration()/60, 1) . ' min)'; } @@ -367,6 +368,15 @@ class Session return true; } + function countFinishedPlans() : int + { + $n = 0; + foreach($this->plans as $plan) + if(!$plan->isOver()) + $n++; + return $n; + } + function trySendStatsFromJzonAsync(Task $task, string $jzon) : Amp\Promise { return Amp\call(function() use($task, $jzon) {