This commit is contained in:
2025-02-10 01:58:12 +02:00
parent 25d99e7b72
commit 87bbfc33d3
242 changed files with 38662 additions and 99 deletions
@@ -46,6 +46,29 @@ class MovieProcessingService implements ProcessingInterface
$this->listApi = $listApi;
}
public static function getBatch(int $batch, string $job)
{
if ($job === ItemToFetchJobs::JOB_DETAILS) {
return ItemToFetchJobs::leftJoin('movies', function ($join) {
$join->on('movies.tmdb_id', '=', 'item_to_fetch_jobs.tmdb_id');
})
->whereRaw("FIND_IN_SET('".ItemToFetchJobs::JOB_DETAILS."', item_to_fetch_jobs.jobs)")
->where('item_to_fetch_jobs.type', 'movies')
->whereNull('movies.id')
->take($batch)
->get();
}
return ItemToFetchJobs::leftJoin('movies', function ($join) {
$join->on('movies.tmdb_id', '=', 'item_to_fetch_jobs.tmdb_id');
})
->whereRaw("FIND_IN_SET('".$job."', item_to_fetch_jobs.jobs)")
->where('item_to_fetch_jobs.type', 'tv_series')
->whereNotNull('movies.id')
->take($batch)
->get();
}
public function process($item, $job)
{
$methodName = "get".ucfirst($job);