Files
UNIT3D-Community-Edition/app/Jobs/ProcessCollectionJob.php
2022-01-10 17:46:43 -05:00

48 lines
1.1 KiB
PHP

<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
*
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
* @author HDVinnie
*/
namespace App\Jobs;
use App\Services\Tmdb\TMDBScraper;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class ProcessCollectionJob implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* ProcessCollectionJob Constructor.
*/
public function __construct(public $collection)
{
}
/**
* Execute the job.
*/
public function handle(): void
{
foreach ($this->collection['parts'] as $parts) {
$metadata = new TMDBScraper();
$metadata->movie($parts['id']);
}
}
}