Skip to content

Commit

Permalink
Fix TV RunTime
Browse files Browse the repository at this point in the history
  • Loading branch information
arkamali committed Apr 12, 2024
1 parent a744372 commit ccbe99e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ public function runtime(): ?int
elseif (preg_match('/(\d{1,2})h/', $runtimeValue, $matches)) {
$m = isset($matches[1]) ? intval($matches[1]) * 60 : 0;
return $this->data['runtime'] = $m;
} // ..hour
elseif (preg_match('/(\d{1,2}) hour/', $runtimeValue, $matches)) {
$m = isset($matches[1]) ? intval($matches[1]) * 60 : 0;
return $this->data['runtime'] = $m;
} // ..minutes
elseif (preg_match('/(\d{1,2}) minutes/', $runtimeValue, $matches)) {
$m = isset($matches[1]) ? intval($matches[1]) : 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/TitleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testRuntime()
public function testRuntimeTVSeries()
{
$title = $this->getTitle("0306414"); // The Wire
$this->assertEquals(59, $title->runtime());
$this->assertEquals(60, $title->runtime());
}

public function testRuntimeTVEpisode()
Expand Down

0 comments on commit ccbe99e

Please sign in to comment.