From ea7f5f53ccd034d11df90a9d409a271fa52fc573 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 21 Jun 2017 11:29:08 +0200 Subject: [PATCH] Fix issues with multiple same name actors in ADE class --- nntmux/processing/adult/ADE.php | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/nntmux/processing/adult/ADE.php b/nntmux/processing/adult/ADE.php index bb4451c4f..3b5abc09c 100755 --- a/nntmux/processing/adult/ADE.php +++ b/nntmux/processing/adult/ADE.php @@ -136,12 +136,13 @@ class ADE extends AdultMovies */ public function cast() { - foreach ($this->_html->find('a.PerformerName') as $a) { - if ($a->plaintext !== 'bio' && $a->plaintext !== 'interview') { - $this->_res['cast'][] = trim($a->innertext); - } + $cast = []; + foreach ($this->_html->find('[Label="Performers - detail"]') as $a) { + if ($a->plaintext !== false) { + $cast[] = trim($a->plaintext); } - + } + $this->_res['cast'] = $cast; return $this->_res; } @@ -152,22 +153,12 @@ class ADE extends AdultMovies public function genres() { $genres = []; - $ret = $this->_html->find('h2[border-bottom-site-default]'); - foreach ($ret as $categories) { - $cats = $categories->find('a[label]'); - foreach ($cats as $c) { - $categories = trim($c); - if (strpos($categories, ',') !== false) { - $genres = explode(',', $categories); - $genres = array_map('trim', $genres); - } else { - $genres[] = $categories; - } - } - } - if (is_array($genres)) { - $this->_res['genres'] = array_unique($genres); + foreach ($this->_html->find('[Label="Category"]') as $a) { + if ($a->plaintext !== false) { + $genres[] = trim($a->plaintext); } + } + $this->_res['genres'] = $genres; return $this->_res; }