diff --git a/docker-compose.yml b/docker-compose.yml index 27ba439..27fddf4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -141,8 +141,8 @@ services: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 - - SE_NODE_MAX_SESSIONS=1 - - SE_NODE_MAX_SESSION=1 + - SE_NODE_MAX_SESSIONS=2 + - SE_NODE_MAX_SESSION=2 # edge: # image: selenium/node-edge:nightly diff --git a/php/src/app/Http/Controllers/ApiController.php b/php/src/app/Http/Controllers/ApiController.php index f32304d..1e66c4a 100644 --- a/php/src/app/Http/Controllers/ApiController.php +++ b/php/src/app/Http/Controllers/ApiController.php @@ -24,7 +24,7 @@ class ApiController extends Controller 'name' => $artist->name, 'url_remote' => $artist->url_remote, 'state' => $artist->state, - 'thumbnail' => $artist->thumbnail, + 'thumbnail' => str_replace('/var/www/html/public', '', $artist->image), ]; } $response = json_encode(array('data' => $data)); @@ -43,8 +43,8 @@ class ApiController extends Controller 'name' => $album->name, 'artist_id' => $artist->toArray(), 'url_remote' => $album->url_remote, - 'thumbnail' => $album->thumbnail, - 'image' => $album->image, + 'thumbnail' => str_replace('/var/www/html/public', '', $album->image), + 'image' => str_replace('/var/www/html/public', '', $album->image), 'state' => $queue->state, ]; } diff --git a/php/src/app/Models/Album.php b/php/src/app/Models/Album.php index 89dfc62..4d31f83 100644 --- a/php/src/app/Models/Album.php +++ b/php/src/app/Models/Album.php @@ -21,6 +21,11 @@ class Album extends Model $this->save(); } + public function getAlbumImageLocation() + { + return str_replace('/var/www/html', '', $this->image); + } + public static function findByArtistTitle(Artist $artist, string $name) { return self::where('name', '=', $name)->where('artist_id', '=', $artist->id)->first(); diff --git a/php/src/app/Models/Artist.php b/php/src/app/Models/Artist.php index 329f408..b3b9cd7 100644 --- a/php/src/app/Models/Artist.php +++ b/php/src/app/Models/Artist.php @@ -30,6 +30,11 @@ class Artist extends Model return self::where('id', '=', $id)->get(); } + public function getArtistImageLocation() + { + return str_replace('/var/www/html', '', $this->image); + } + public static function addArtist(string $name, string $thumbnail, string $url_remote, string $image) { $artist = new Artist(); diff --git a/php/src/app/Models/WebScraper.php b/php/src/app/Models/WebScraper.php index 481a8ff..9e79045 100644 --- a/php/src/app/Models/WebScraper.php +++ b/php/src/app/Models/WebScraper.php @@ -117,7 +117,7 @@ class WebScraper 'name' => $albumTitle, 'artist_id' => $artist->id, 'thumbnail' => $albumThumbnail, - 'url_remote' => $albumHref, + 'url_remote' => $albumHref, // TODO: Check here if the image is a 'gif' and not a URL 'image' => $imageFileUrl, ]; $album_id = Album::findOrCreateByName($artist, $albumTitle, $data); @@ -167,8 +167,6 @@ class WebScraper for ($i = 0; $i <= 3; $i++) { if ($caroselNextButton[0]->isEnabled()) { $action = $driver->action(); - $script = "arguments[0].scrollIntoView();"; - $driver->executeScript($script, $caroselNextButton); $action->moveToElement($caroselNextButton[0])->click()->perform(); sleep(5); } diff --git a/php/src/public/js/app.js b/php/src/public/js/app.js index 30e0663..bcdab7a 100644 --- a/php/src/public/js/app.js +++ b/php/src/public/js/app.js @@ -13,12 +13,14 @@ function requestQueue() { } function template_artist_result(element) { + let image_src = element.image.replace('/var/www/html/public', ''); + console.log(image_src); return `