diff --git a/engines/imdb.php b/engines/imdb.php index 034cedd0..a771253e 100644 --- a/engines/imdb.php +++ b/engines/imdb.php @@ -175,7 +175,7 @@ function imdbData($imdbID) $data['subtitle'] = trim($s); } # orig. title - preg_match('/\s*(.*?)\s*\(original title\)<\/i>\s*\s*"?(.*?)"?\s*\(original title\)<\/i>\s*(.*)#si', $resp['data'], $match)) + if (preg_match('#(.*)#si', $resp['data'], $match)) { - if (preg_match_all('##si', $match[1], $ary, PREG_PATTERN_ORDER)) + // no idea why it does not always work with (.*?)
(.*?).*?(.*?)
\s+(.*?).*?(.*?)#si', $casthtml, $ary, PREG_PATTERN_ORDER)) { for ($i=0; $i < sizeof($ary[0]); $i++) { $actorid = trim(strip_tags($ary[1][$i])); $actor = trim(strip_tags($ary[2][$i])); - $character = trim(strip_tags($ary[3][$i])); + $character = trim( preg_replace('/\s+/', ' ', strip_tags( preg_replace('/ /', ' ', $ary[3][$i])))); $cast .= "$actor::$character::$imdbIdPrefix$actorid\n"; } } @@ -410,7 +414,7 @@ function imdbActor($name, $actorid) // now we should have loaded the best match // only search in img_primary - or we get far to many useless images - preg_match('/(.*?)<\/td>/si',$resp['data'], $match); + preg_match('/(.*?)<\/td>/si',$resp['data'], $match); if (preg_match('/.*?\s*assertTrue($data['runtime'] >= 99 && $data['runtime'] <= 101); } + /* + Disabled test. + Runtime of this movie was removed on IMDB + function testMovie6() { // She's Out of My League // http://www.imdb.com/title/tt0815236/ @@ -127,6 +131,7 @@ function testMovie6() { $this->assertEqual($data['runtime'], 104); } + */ function testMovie7() { // Romasanta @@ -235,7 +240,7 @@ function testSeriesEpisode() $this->assertTrue( in_array('Jonathan Frakes::Commander William T. Riker::imdb:nm0000408', $cast) ); $this->assertTrue( in_array('Marina Sirtis::Counselor Deanna Troi::imdb:nm0000642', $cast) ); $this->assertTrue( in_array('John de Lancie::Q (as John deLancie)::imdb:nm0209496', $cast) ); - $this->assertTrue( in_array('Rob Bowman::Borg (voice)::imdb:nm0101385', $cast) ); + $this->assertTrue( in_array('Rob Bowman::Borg (voice) (uncredited)::imdb:nm0101385', $cast) ); $this->assertTrue( sizeof($cast) > 15 ); $this->assertTrue( sizeof($cast) < 30 );