Archived
1
0
Fork 0

Fixes and skipping on existing games

This commit is contained in:
Alexander Yakovlev 2020-01-04 22:56:58 +07:00
parent 4dba8c0223
commit 261e224e7c
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3
2 changed files with 8 additions and 3 deletions

View file

@ -99,7 +99,6 @@ abstract class Source {
->where('source_id', $game->source_id)
->first();
if ($dbmodel) {
$dbmodel->fill($game->toArray());
return $dbmodel;
}
}

View file

@ -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();