progress
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user