1 | <?php |
||
2 | |||
3 | namespace App\Services; |
||
4 | |||
5 | use App\Models\Settings; |
||
6 | use Blacklight\processing\tv\TMDB; |
||
7 | use Blacklight\processing\tv\TraktTv; |
||
8 | use Blacklight\processing\tv\TVDB; |
||
9 | use Blacklight\processing\tv\TVMaze; |
||
10 | |||
11 | class TvProcessor |
||
12 | { |
||
13 | private bool $echooutput; |
||
14 | |||
15 | public function __construct(bool $echooutput) |
||
16 | { |
||
17 | $this->echooutput = $echooutput; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * Process all TV related releases across supported providers. |
||
22 | * |
||
23 | * @param int|string|null $processTV 0/1/2 or '' to read from settings |
||
24 | */ |
||
25 | public function process(string $groupID = '', string $guidChar = '', int|string|null $processTV = ''): void |
||
26 | { |
||
27 | $processTV = (is_numeric($processTV) ? $processTV : Settings::settingValue('lookuptv')); |
||
28 | if ($processTV > 0) { |
||
29 | (new TVDB)->processSite($groupID, $guidChar, $processTV); |
||
30 | (new TVMaze)->processSite($groupID, $guidChar, $processTV); |
||
31 | (new TMDB)->processSite($groupID, $guidChar, $processTV); |
||
32 | (new TraktTv)->processSite($groupID, $guidChar, $processTV); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
33 | } |
||
34 | } |
||
35 | } |
||
36 |