diff --git a/php/src/app/Console/Commands/UpdateArtistImages.php b/php/src/app/Console/Commands/UpdateArtistImages.php new file mode 100644 index 0000000..3e247e6 --- /dev/null +++ b/php/src/app/Console/Commands/UpdateArtistImages.php @@ -0,0 +1,42 @@ +output, count($artists)); + $bar->start(); + foreach ($artists as $artist) { + $image_url = ImageUrl::modifyGoogleImageUrl($artist->thumbnail); + $image_file = ImageUrl::save_img_url($image_url); + $artist->image = $image_file; + $artist->save(); + $bar->advance(); + } + } +} diff --git a/php/src/public/js/app.js b/php/src/public/js/app.js index 22bd256..e87cbde 100644 --- a/php/src/public/js/app.js +++ b/php/src/public/js/app.js @@ -122,13 +122,9 @@ document.addEventListener('alpine:init', () => { Alpine.store('app', { init() { // TODO: Poll for artists and queue - // this.Artists = []; this.Queue = []; - // this.ArtistResults = []; }, - // Artists: [], // Rendered in the 'Artists' modal - // ArtistResults: [], // Rendered in the SWAL popup Queue: [], // Rendered in the 'Queue' modal }); @@ -138,6 +134,7 @@ document.addEventListener('alpine:init', () => { }); $(document).ready(function () { + //Datatable for 'Catalog' menu let ArtistTable = $('#artistsCatalogDatatable').DataTable({ ajax: '/api/artists', type: 'get', @@ -165,10 +162,9 @@ $(document).ready(function () { } ], }); - - // const getArtistTableInterval = setInterval(function() { - // table.ajax.reload(); - // }, 5000); - + // Polling for table update + const getArtistTableInterval = setInterval(function() { + table.ajax.reload(); + }, 5000); });