@@ -35,13 +35,13 @@ |
||
| 35 | 35 | $renamed = $this->argument('renamed') ?? ''; |
| 36 | 36 | $mode = $this->option('mode') ?? 'pipeline'; |
| 37 | 37 | |
| 38 | - if (! $this->isValidChar($guid)) { |
|
| 38 | + if (!$this->isValidChar($guid)) { |
|
| 39 | 39 | $this->error('GUID character must be a-f or 0-9.'); |
| 40 | 40 | |
| 41 | 41 | return self::FAILURE; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if (! in_array($mode, ['pipeline', 'parallel', 'laravel'], true)) { |
|
| 44 | + if (!in_array($mode, ['pipeline', 'parallel', 'laravel'], true)) { |
|
| 45 | 45 | $this->error('Mode must be either "pipeline", "parallel", or "laravel".'); |
| 46 | 46 | |
| 47 | 47 | return self::FAILURE; |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | public function hasValidParsedInfo(): bool |
| 71 | 71 | { |
| 72 | 72 | return $this->parsedInfo !== null |
| 73 | - && ! empty($this->parsedInfo['name']) |
|
| 73 | + && !empty($this->parsedInfo['name']) |
|
| 74 | 74 | && isset($this->parsedInfo['season'], $this->parsedInfo['episode']); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | protected function displayHeader(string $guidChar = ''): void |
| 250 | 250 | { |
| 251 | - if (! $this->echoOutput) { |
|
| 251 | + if (!$this->echoOutput) { |
|
| 252 | 252 | return; |
| 253 | 253 | } |
| 254 | 254 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | protected function displaySummary(): void |
| 271 | 271 | { |
| 272 | - if (! $this->echoOutput) { |
|
| 272 | + if (!$this->echoOutput) { |
|
| 273 | 273 | return; |
| 274 | 274 | } |
| 275 | 275 | |
@@ -286,12 +286,12 @@ discard block |
||
| 286 | 286 | $this->colorCli->warning(sprintf('%.2fs', $this->stats['duration'])); |
| 287 | 287 | echo "\n"; |
| 288 | 288 | |
| 289 | - if (! empty($this->stats['providers'])) { |
|
| 289 | + if (!empty($this->stats['providers'])) { |
|
| 290 | 290 | $providerSummary = []; |
| 291 | 291 | foreach ($this->stats['providers'] as $provider => $count) { |
| 292 | 292 | $providerSummary[] = "$provider: $count"; |
| 293 | 293 | } |
| 294 | - $this->colorCli->primary(' Matches by provider: ' . implode(', ', $providerSummary)); |
|
| 294 | + $this->colorCli->primary(' Matches by provider: '.implode(', ', $providerSummary)); |
|
| 295 | 295 | echo "\n"; |
| 296 | 296 | } |
| 297 | 297 | } |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | // Fetch poster if we have one |
| 91 | - if (! empty($tvmazeShow['poster'] ?? '')) { |
|
| 91 | + if (!empty($tvmazeShow['poster'] ?? '')) { |
|
| 92 | 92 | $tvmaze->getPoster($videoId); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Process episode |
| 96 | - $seriesNo = ! empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 97 | - $episodeNo = ! empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 98 | - $hasAirdate = ! empty($parsedInfo['airdate']); |
|
| 96 | + $seriesNo = !empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 97 | + $episodeNo = !empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 98 | + $hasAirdate = !empty($parsedInfo['airdate']); |
|
| 99 | 99 | |
| 100 | 100 | if ($episodeNo === 'all') { |
| 101 | 101 | // Full season release |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Download all episodes if new show to reduce API/bandwidth usage |
| 108 | - if (! $tvmaze->countEpsByVideoID($videoId)) { |
|
| 108 | + if (!$tvmaze->countEpsByVideoID($videoId)) { |
|
| 109 | 109 | $tvmaze->getEpisodeInfo($siteId, -1, -1); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | private function outputFullSeason(string $title): void |
| 168 | 168 | { |
| 169 | - if (! $this->echoOutput) { |
|
| 169 | + if (!$this->echoOutput) { |
|
| 170 | 170 | return; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | // Found a matching show in local DB |
| 61 | 61 | $episodeId = false; |
| 62 | 62 | $hasEpisodeNumbers = $this->hasEpisodeNumbers($parsedInfo); |
| 63 | - $hasAirdate = ! empty($parsedInfo['airdate']); |
|
| 63 | + $hasAirdate = !empty($parsedInfo['airdate']); |
|
| 64 | 64 | |
| 65 | 65 | if ($hasEpisodeNumbers || $hasAirdate) { |
| 66 | 66 | // Try to find the specific episode |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | // Fetch poster if we have one |
| 91 | - if (! empty($tmdbShow['poster'] ?? '')) { |
|
| 91 | + if (!empty($tmdbShow['poster'] ?? '')) { |
|
| 92 | 92 | $tmdb->getPoster($videoId); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Process episode |
| 96 | - $seriesNo = ! empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 97 | - $episodeNo = ! empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 98 | - $hasAirdate = ! empty($parsedInfo['airdate']); |
|
| 96 | + $seriesNo = !empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 97 | + $episodeNo = !empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 98 | + $hasAirdate = !empty($parsedInfo['airdate']); |
|
| 99 | 99 | |
| 100 | 100 | if ($episodeNo === 'all') { |
| 101 | 101 | // Full season release |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Download all episodes if new show to reduce API/bandwidth usage |
| 108 | - if (! $tmdb->countEpsByVideoID($videoId)) { |
|
| 108 | + if (!$tmdb->countEpsByVideoID($videoId)) { |
|
| 109 | 109 | $tmdb->getEpisodeInfo($siteId, -1, -1); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | private function outputFullSeason(string $title): void |
| 168 | 168 | { |
| 169 | - if (! $this->echoOutput) { |
|
| 169 | + if (!$this->echoOutput) { |
|
| 170 | 170 | return; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // Skip if we don't have valid parsed info |
| 39 | - if (! $passable->hasValidParsedInfo()) { |
|
| 39 | + if (!$passable->hasValidParsedInfo()) { |
|
| 40 | 40 | return $next($passable); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | return $title; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - return mb_substr($title, 0, $maxLength - 3) . '...'; |
|
| 134 | + return mb_substr($title, 0, $maxLength - 3).'...'; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | protected function outputMatch(string $title, ?int $season = null, ?int $episode = null, ?string $airdate = null): void |
| 141 | 141 | { |
| 142 | - if (! $this->echoOutput) { |
|
| 142 | + if (!$this->echoOutput) { |
|
| 143 | 143 | return; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $this->colorCli->primaryOver(' ✓ '); |
| 160 | - $this->colorCli->primary('MATCHED (' . $this->getName() . ')'); |
|
| 160 | + $this->colorCli->primary('MATCHED ('.$this->getName().')'); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | protected function outputNotFound(string $title): void |
| 167 | 167 | { |
| 168 | - if (! $this->echoOutput) { |
|
| 168 | + if (!$this->echoOutput) { |
|
| 169 | 169 | return; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | protected function outputSearching(string $title): void |
| 182 | 182 | { |
| 183 | - if (! $this->echoOutput) { |
|
| 183 | + if (!$this->echoOutput) { |
|
| 184 | 184 | return; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | $this->colorCli->primaryOver(' → '); |
| 188 | 188 | $this->colorCli->headerOver($this->truncateTitle($title)); |
| 189 | 189 | $this->colorCli->primaryOver(' → '); |
| 190 | - $this->colorCli->info('Searching ' . $this->getName() . '...'); |
|
| 190 | + $this->colorCli->info('Searching '.$this->getName().'...'); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | protected function outputFoundInDb(string $title): void |
| 197 | 197 | { |
| 198 | - if (! $this->echoOutput) { |
|
| 198 | + if (!$this->echoOutput) { |
|
| 199 | 199 | return; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -210,14 +210,14 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | protected function outputSkipped(string $title, string $reason = 'previously failed'): void |
| 212 | 212 | { |
| 213 | - if (! $this->echoOutput) { |
|
| 213 | + if (!$this->echoOutput) { |
|
| 214 | 214 | return; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $this->colorCli->primaryOver(' → '); |
| 218 | 218 | $this->colorCli->alternateOver($this->truncateTitle($title)); |
| 219 | 219 | $this->colorCli->primaryOver(' → '); |
| 220 | - $this->colorCli->alternate('Skipped (' . $reason . ')'); |
|
| 220 | + $this->colorCli->alternate('Skipped ('.$reason.')'); |
|
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
@@ -96,16 +96,16 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Fetch poster if available |
| 99 | - if (! empty($posterUrl)) { |
|
| 99 | + if (!empty($posterUrl)) { |
|
| 100 | 100 | $tvdb->getPoster($videoId); |
| 101 | 101 | } else { |
| 102 | 102 | $this->fetchFanartPoster($videoId, $siteId); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // Process episode |
| 106 | - $seriesNo = ! empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 107 | - $episodeNo = ! empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 108 | - $hasAirdate = ! empty($parsedInfo['airdate']); |
|
| 106 | + $seriesNo = !empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 107 | + $episodeNo = !empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 108 | + $hasAirdate = !empty($parsedInfo['airdate']); |
|
| 109 | 109 | |
| 110 | 110 | if ($episodeNo === 'all') { |
| 111 | 111 | // Full season release |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // Download all episodes if new show to reduce API/bandwidth usage |
| 118 | - if (! $tvdb->countEpsByVideoID($videoId)) { |
|
| 118 | + if (!$tvdb->countEpsByVideoID($videoId)) { |
|
| 119 | 119 | $tvdb->getEpisodeInfo($siteId, -1, -1, $videoId); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -186,9 +186,9 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | $poster = $this->fanart->getTVFanArt($siteId); |
| 189 | - if (is_array($poster) && ! empty($poster['tvposter'])) { |
|
| 189 | + if (is_array($poster) && !empty($poster['tvposter'])) { |
|
| 190 | 190 | $best = collect($poster['tvposter'])->sortByDesc('likes')->first(); |
| 191 | - if (! empty($best['url'])) { |
|
| 191 | + if (!empty($best['url'])) { |
|
| 192 | 192 | $this->getTvdb()->posterUrl = $best['url']; |
| 193 | 193 | $this->getTvdb()->getPoster($videoId); |
| 194 | 194 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | private function outputFullSeason(string $title): void |
| 202 | 202 | { |
| 203 | - if (! $this->echoOutput) { |
|
| 203 | + if (!$this->echoOutput) { |
|
| 204 | 204 | return; |
| 205 | 205 | } |
| 206 | 206 | |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // Process episode |
| 87 | - $seriesNo = ! empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 88 | - $episodeNo = ! empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 89 | - $hasAirdate = ! empty($parsedInfo['airdate']); |
|
| 87 | + $seriesNo = !empty($parsedInfo['season']) ? preg_replace('/^S0*/i', '', (string) $parsedInfo['season']) : ''; |
|
| 88 | + $episodeNo = !empty($parsedInfo['episode']) ? preg_replace('/^E0*/i', '', (string) $parsedInfo['episode']) : ''; |
|
| 89 | + $hasAirdate = !empty($parsedInfo['airdate']); |
|
| 90 | 90 | |
| 91 | 91 | if ($episodeNo === 'all') { |
| 92 | 92 | // Full season release |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Download all episodes if new show to reduce API/bandwidth usage |
| 99 | - if (! $trakt->countEpsByVideoID($videoId)) { |
|
| 99 | + if (!$trakt->countEpsByVideoID($videoId)) { |
|
| 100 | 100 | $trakt->getEpisodeInfo($siteId, -1, -1); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | private function outputFullSeason(string $title): void |
| 159 | 159 | { |
| 160 | - if (! $this->echoOutput) { |
|
| 160 | + if (!$this->echoOutput) { |
|
| 161 | 161 | return; |
| 162 | 162 | } |
| 163 | 163 | |