Browse Source

fixed sonarr season count issue with new API version

CauseFX 4 years ago
parent
commit
8b6cc827c1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      api/homepage/sonarr.php

+ 2 - 2
api/homepage/sonarr.php

@@ -290,11 +290,11 @@ trait SonarrHomepageItem
 			}
 			$bottomTitle = 'S' . sprintf("%02d", $child['seasonNumber']) . 'E' . sprintf("%02d", $child['episodeNumber']) . ' - ' . $child['title'];
 			$details = array(
-				"seasonCount" => $child['series']['seasonCount'],
+				"seasonCount" => $child['series']['seasonCount'] ?? isset($child['series']['seasons']) ? count($child['series']['seasons']) : 0,
 				"status" => $child['series']['status'],
 				"topTitle" => $seriesName,
 				"bottomTitle" => $bottomTitle,
-				"overview" => isset($child['overview']) ? $child['overview'] : '',
+				"overview" => $child['overview'] ?? '',
 				"runtime" => $child['series']['runtime'],
 				"image" => $fanart,
 				"ratings" => $child['series']['ratings']['value'],