Skip to content

Commit 3ede8c9

Browse files
committed
feat: only get seasons if tvShow is true
1 parent 3cad86d commit 3ede8c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Imdb.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private function populateOptions(array $options = []): array
2525
'category' => 'all',
2626
'curlHeaders' => ['Accept-Language: en-US,en;q=0.5'],
2727
'techSpecs' => true,
28-
'seasons' => true,
28+
'seasons' => false,
2929
];
3030

3131
// Merge any user options with the default ones
@@ -116,8 +116,8 @@ public function film(string $filmId, array $options = []): array
116116
$response->add("technical_specs", $htmlPieces->get($page_techSpecs, "technical_specs"));
117117
}
118118

119-
// If seasons is enabled
120-
if ($options['seasons']) {
119+
// If seasons is enabled & is a tv show
120+
if ($options['seasons'] && $response->get("tvShow")) {
121121
$url = "https://www.imdb.com/title/$filmId/episodes";
122122
$page_seasons = $dom->fetch($url, $options);
123123
// If film has episodes or seasons

0 commit comments

Comments
 (0)