From 8118e86a495a29a32f1fc7e313d83495b3ceee10 Mon Sep 17 00:00:00 2001 From: Radu Galbenu Date: Wed, 12 Aug 2026 20:05:16 +0300 Subject: [PATCH 1/4] Tracearr: add enhanced support with stream/transcode/bandwidth stats Auths with a Tracearr public API key (Bearer), hits /api/v2/public/streams?summary=true, and surfaces active streams, active transcodes, and total bandwidth on the dashboard tile. --- Tracearr/Tracearr.php | 48 +++++++++++++++++++++++++++++++++++- Tracearr/app.json | 2 +- Tracearr/config.blade.php | 14 +++++++++++ Tracearr/livestats.blade.php | 14 +++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 Tracearr/config.blade.php create mode 100644 Tracearr/livestats.blade.php diff --git a/Tracearr/Tracearr.php b/Tracearr/Tracearr.php index 7980725704..5844af88c6 100644 --- a/Tracearr/Tracearr.php +++ b/Tracearr/Tracearr.php @@ -2,6 +2,52 @@ namespace App\SupportedApps\Tracearr; -class Tracearr extends \App\SupportedApps +class Tracearr extends \App\SupportedApps implements \App\EnhancedApps { + public $config; + + public function test() + { + $test = parent::appTest($this->url("api/v2/public/streams?summary=true"), $this->getAttrs()); + echo $test->status; + } + + public function livestats() + { + $status = "inactive"; + $data = []; + + $res = parent::execute($this->url("api/v2/public/streams?summary=true"), $this->getAttrs()); + $details = json_decode($res->getBody()); + $summary = $details->summary ?? null; + + if ($summary) { + $data = [ + "streams" => $summary->total, + "transcodes" => $summary->transcodes, + "bandwidth" => $summary->total_bitrate, + ]; + if ($summary->total > 0) { + $status = "active"; + } + } + + return parent::getLiveStats($status, $data); + } + + public function url($endpoint) + { + $api_url = parent::normaliseurl($this->config->url) . $endpoint; + return $api_url; + } + + private function getAttrs() + { + return [ + "headers" => [ + "Accept" => "application/json", + "Authorization" => "Bearer " . $this->config->apikey, + ], + ]; + } } diff --git a/Tracearr/app.json b/Tracearr/app.json index 8e73220bfe..9ccdd58865 100644 --- a/Tracearr/app.json +++ b/Tracearr/app.json @@ -4,7 +4,7 @@ "website": "https://tracearr.com", "license": "Other", "description": "Real-time monitoring for Plex, Jellyfin, and Emby servers. Track streams, analyze playback, and detect account sharing from a single dashboard.", - "enhanced": false, + "enhanced": true, "tile_background": "dark", "icon": "tracearr.png" } diff --git a/Tracearr/config.blade.php b/Tracearr/config.blade.php new file mode 100644 index 0000000000..4a8082c945 --- /dev/null +++ b/Tracearr/config.blade.php @@ -0,0 +1,14 @@ +

{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')

+
+
+ + {!! Form::text('config[override_url]', isset($item) ? $item->getconfig()->override_url : null, ['placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control']) !!} +
+
+ + {!! Form::text('config[apikey]', isset($item) ? $item->getconfig()->apikey : null, ['placeholder' => __('app.apps.apikey'), 'data-config' => 'apikey', 'class' => 'form-control config-item']) !!} +
+
+ +
+
diff --git a/Tracearr/livestats.blade.php b/Tracearr/livestats.blade.php new file mode 100644 index 0000000000..9204daf0d9 --- /dev/null +++ b/Tracearr/livestats.blade.php @@ -0,0 +1,14 @@ + From 1bc7a6788c864f82e2dd9172f6d8b0e028e84fe7 Mon Sep 17 00:00:00 2001 From: Radu Galbenu Date: Wed, 12 Aug 2026 20:25:16 +0300 Subject: [PATCH 2/4] Tracearr: handle unreachable/errored API in livestats() Found via local integration testing: execute() can return null on connection failure, and the old code called ->getBody() on it unconditionally, throwing a fatal error instead of degrading the tile. A missing/malformed summary also left $data empty, causing "undefined variable" warnings in the livestats view. Default the stats to zero and guard the null case. --- Tracearr/Tracearr.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Tracearr/Tracearr.php b/Tracearr/Tracearr.php index 5844af88c6..c5634308a1 100644 --- a/Tracearr/Tracearr.php +++ b/Tracearr/Tracearr.php @@ -15,18 +15,19 @@ public function test() public function livestats() { $status = "inactive"; - $data = []; + $data = [ + "streams" => 0, + "transcodes" => 0, + "bandwidth" => "0 Mbps", + ]; $res = parent::execute($this->url("api/v2/public/streams?summary=true"), $this->getAttrs()); - $details = json_decode($res->getBody()); - $summary = $details->summary ?? null; + $summary = $res ? (json_decode($res->getBody())->summary ?? null) : null; if ($summary) { - $data = [ - "streams" => $summary->total, - "transcodes" => $summary->transcodes, - "bandwidth" => $summary->total_bitrate, - ]; + $data["streams"] = $summary->total; + $data["transcodes"] = $summary->transcodes; + $data["bandwidth"] = $summary->total_bitrate; if ($summary->total > 0) { $status = "active"; } From be5d71987779aaa03fda4ad278958d65d8253ccc Mon Sep 17 00:00:00 2001 From: Radu Galbenu Date: Wed, 12 Aug 2026 20:35:50 +0300 Subject: [PATCH 3/4] Tracearr: add skip TLS verification option --- Tracearr/Tracearr.php | 8 +++++++- Tracearr/config.blade.php | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Tracearr/Tracearr.php b/Tracearr/Tracearr.php index c5634308a1..e96ac9b93b 100644 --- a/Tracearr/Tracearr.php +++ b/Tracearr/Tracearr.php @@ -44,11 +44,17 @@ public function url($endpoint) private function getAttrs() { - return [ + $attrs = [ "headers" => [ "Accept" => "application/json", "Authorization" => "Bearer " . $this->config->apikey, ], ]; + + if (!empty($this->config->ignore_tls)) { + $attrs["verify"] = false; + } + + return $attrs; } } diff --git a/Tracearr/config.blade.php b/Tracearr/config.blade.php index 4a8082c945..a97c9979e8 100644 --- a/Tracearr/config.blade.php +++ b/Tracearr/config.blade.php @@ -8,6 +8,23 @@ {!! Form::text('config[apikey]', isset($item) ? $item->getconfig()->apikey : null, ['placeholder' => __('app.apps.apikey'), 'data-config' => 'apikey', 'class' => 'form-control config-item']) !!} +
+ +
+ {!! Form::hidden('config[ignore_tls]', 0, ['class' => 'config-item', 'data-config' => 'ignore_tls']) !!} + +
+
From 4bd95a96733af156f3fca76aba0adcbfed969ff4 Mon Sep 17 00:00:00 2001 From: Radu Galbenu Date: Wed, 12 Aug 2026 20:48:54 +0300 Subject: [PATCH 4/4] Trigger CI rerun