Fixes and skipping on existing games
This commit is contained in:
parent
4dba8c0223
commit
261e224e7c
|
@ -99,7 +99,6 @@ abstract class Source {
|
|||
->where('source_id', $game->source_id)
|
||||
->first();
|
||||
if ($dbmodel) {
|
||||
$dbmodel->fill($game->toArray());
|
||||
return $dbmodel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class Anivisual extends Source {
|
|||
|
||||
// Get the game link
|
||||
$link = $gameBlock->filter('.novel-ttl a')->first();
|
||||
$link = 'http://anivisual.net'.$link->attr('href');
|
||||
$link = 'http://anivisual.net'.$link->attr('href');
|
||||
$this->page($link);
|
||||
});
|
||||
}
|
||||
|
@ -80,6 +80,9 @@ class Anivisual extends Source {
|
|||
$game->source_id = str_replace('http://anivisual.net/stuff/', '', $url);
|
||||
|
||||
$game = $this->findGame($game);
|
||||
if ($game->isClean()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$gameBlock = $this->dom->filter('#casing-box');
|
||||
$dateBlock = $this->dom->filter('.icon-calendar');
|
||||
|
@ -91,7 +94,10 @@ class Anivisual extends Source {
|
|||
foreach ($this->months as $ruM => $enM) {
|
||||
$date = str_replace($ruM, $enM, $date);
|
||||
}
|
||||
$game->release_date = \DateTime::createFromFormat('d F Y', $date);
|
||||
$release_date = \DateTime::createFromFormat('d F Y', $date);
|
||||
if (!empty($release_date)) {
|
||||
$game->release_date = $release_date;
|
||||
}
|
||||
unset($date);
|
||||
}
|
||||
$title = $this->dom->filter('h1.logo')->first();
|
||||
|
|
Reference in a new issue