1 | <?php |
||
2 | |||
3 | namespace App\Services; |
||
4 | |||
5 | use App\Models\Settings; |
||
6 | use Blacklight\Movie; |
||
7 | use GuzzleHttp\Exception\GuzzleException; |
||
8 | |||
9 | class MoviesProcessor |
||
10 | { |
||
11 | private bool $echooutput; |
||
12 | |||
13 | public function __construct(bool $echooutput) |
||
14 | { |
||
15 | $this->echooutput = $echooutput; |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * @param int|string|null $processMovies 0/1/2 or '' to read from settings |
||
20 | * |
||
21 | * @throws GuzzleException |
||
22 | */ |
||
23 | public function process(string $groupID = '', string $guidChar = '', int|string|null $processMovies = ''): void |
||
24 | { |
||
25 | $processMovies = (is_numeric($processMovies) ? $processMovies : Settings::settingValue('lookupimdb')); |
||
26 | if ($processMovies > 0) { |
||
27 | (new Movie)->processMovieReleases($groupID, $guidChar, $processMovies); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
28 | } |
||
29 | } |
||
30 | } |
||
31 |