Fix Sonarr episode count — episodeFileCount is nested under statistics in v4

This commit is contained in:
Gmer4Lfe
2026-06-06 18:24:31 -04:00
parent a24f9db2ff
commit cac9d8e82f
+2 -1
View File
@@ -78,7 +78,8 @@ function vv_fetch_arr_live(array $arr): array {
if (is_array($data)) {
$out['total'] = count($data);
$out['monitored'] = count(array_filter($data, fn($x) => !empty($x['monitored'])));
$out['episodes'] = array_sum(array_column($data, 'episodeFileCount'));
$out['episodes'] = array_sum(array_map(
fn($x) => $x['statistics']['episodeFileCount'] ?? $x['episodeFileCount'] ?? 0, $data));
}
} elseif ($type === 'radarr') {
$data = vv_arr_http($url, $key, "$base/movie");