@@ -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 | |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | public static function matched(int $videoId, int $episodeId, string $providerName, array $debug = []): self |
| 28 | 28 | { |
| 29 | 29 | return new self( |
| 30 | - status: self::STATUS_MATCHED, |
|
| 31 | - videoId: $videoId, |
|
| 32 | - episodeId: $episodeId, |
|
| 33 | - providerName: $providerName, |
|
| 34 | - debug: $debug, |
|
| 30 | + status : self::STATUS_MATCHED, |
|
| 31 | + videoId : $videoId, |
|
| 32 | + episodeId : $episodeId, |
|
| 33 | + providerName : $providerName, |
|
| 34 | + debug : $debug, |
|
| 35 | 35 | ); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | public static function notFound(?string $providerName = null, array $debug = []): self |
| 42 | 42 | { |
| 43 | 43 | return new self( |
| 44 | - status: self::STATUS_NOT_FOUND, |
|
| 45 | - providerName: $providerName, |
|
| 46 | - debug: $debug, |
|
| 44 | + status : self::STATUS_NOT_FOUND, |
|
| 45 | + providerName : $providerName, |
|
| 46 | + debug : $debug, |
|
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | public static function skipped(string $reason = '', ?string $providerName = null): self |
| 65 | 65 | { |
| 66 | 66 | return new self( |
| 67 | - status: self::STATUS_SKIPPED, |
|
| 68 | - providerName: $providerName, |
|
| 69 | - debug: ['reason' => $reason], |
|
| 67 | + status : self::STATUS_SKIPPED, |
|
| 68 | + providerName : $providerName, |
|
| 69 | + debug : ['reason' => $reason], |
|
| 70 | 70 | ); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function shouldContinueProcessing(): bool |
| 93 | 93 | { |
| 94 | - return ! $this->isMatched(); |
|
| 94 | + return !$this->isMatched(); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -107,23 +107,23 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // Check for known studios/sites |
| 110 | - if (preg_match('/\b(' . self::KNOWN_STUDIOS . ')\b/i', $name)) { |
|
| 110 | + if (preg_match('/\b('.self::KNOWN_STUDIOS.')\b/i', $name)) { |
|
| 111 | 111 | return true; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // Check for known VR sites |
| 115 | - if (preg_match('/\b(' . self::VR_SITES . ')\b/i', $name)) { |
|
| 115 | + if (preg_match('/\b('.self::VR_SITES.')\b/i', $name)) { |
|
| 116 | 116 | return true; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // Check for adult content indicators combined with video markers |
| 120 | - if (preg_match('/\b(' . self::ADULT_KEYWORDS . ')\b/i', $name) && |
|
| 120 | + if (preg_match('/\b('.self::ADULT_KEYWORDS.')\b/i', $name) && |
|
| 121 | 121 | preg_match('/\b(720p|1080p|2160p|4k|mp4|mkv|avi|wmv)\b/i', $name)) { |
| 122 | 122 | return true; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // Check for JAV/AV marker (common in Japanese adult releases) |
| 126 | - if (preg_match('/\b(AV|JAV)\b/', $name) && preg_match('/\b(' . self::KNOWN_STUDIOS . ')\b/i', $name)) { |
|
| 126 | + if (preg_match('/\b(AV|JAV)\b/', $name) && preg_match('/\b('.self::KNOWN_STUDIOS.')\b/i', $name)) { |
|
| 127 | 127 | return true; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | // This pattern is very common for adult sites but rare for regular content |
| 132 | 132 | if (preg_match('/^[A-Za-z]+[.\-_ ](19|20)?\d{2}[.\-_ ]\d{2}[.\-_ ]\d{2}[.\-_ ][A-Za-z]/i', $name)) { |
| 133 | 133 | // Check it's not a TV daily show by checking for adult keywords or specific patterns |
| 134 | - if (preg_match('/\b(' . self::ADULT_KEYWORDS . ')\b/i', $name)) { |
|
| 134 | + if (preg_match('/\b('.self::ADULT_KEYWORDS.')\b/i', $name)) { |
|
| 135 | 135 | return true; |
| 136 | 136 | } |
| 137 | 137 | // Check for performer name patterns (firstname.lastname) after the date |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | // Check for known VR site |
| 172 | - $hasVRSite = preg_match('/\b(' . self::VR_SITES . ')\b/i', $name); |
|
| 172 | + $hasVRSite = preg_match('/\b('.self::VR_SITES.')\b/i', $name); |
|
| 173 | 173 | |
| 174 | 174 | // Require either a VR site token, explicit VR180/VR360, or VR device |
| 175 | 175 | if (!preg_match('/\bVR(?:180|360)\b/i', $name) && |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | // VR pattern matching - includes VR devices |
| 182 | - $vrPattern = '/\b(' . self::VR_SITES . ')\b|\bVR(?:180|360)\b|\b(?:5K|6K|7K|8K)\b.*\bVR\b|\b(?:GearVR|Oculus|Quest[123]?|PSVR|Vive|Index|Pimax)\b/i'; |
|
| 182 | + $vrPattern = '/\b('.self::VR_SITES.')\b|\bVR(?:180|360)\b|\b(?:5K|6K|7K|8K)\b.*\bVR\b|\b(?:GearVR|Oculus|Quest[123]?|PSVR|Vive|Index|Pimax)\b/i'; |
|
| 183 | 183 | |
| 184 | 184 | if (preg_match($vrPattern, $name)) { |
| 185 | 185 | // VR sites are definitively adult content |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | return $this->matched(Category::XXX_VR, 0.95, 'vr_site'); |
| 188 | 188 | } |
| 189 | 189 | // VR device with adult keywords |
| 190 | - if (preg_match('/\bXXX\b/i', $name) || preg_match('/\b(' . self::ADULT_KEYWORDS . ')\b/i', $name)) { |
|
| 190 | + if (preg_match('/\bXXX\b/i', $name) || preg_match('/\b('.self::ADULT_KEYWORDS.')\b/i', $name)) { |
|
| 191 | 191 | return $this->matched(Category::XXX_VR, 0.9, 'vr_device'); |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | // Check for adult markers |
| 205 | 205 | $hasAdultMarker = preg_match('/\bXXX\b/i', $name) || |
| 206 | - preg_match('/\b(' . self::KNOWN_STUDIOS . ')\b/i', strtolower($name)) || |
|
| 206 | + preg_match('/\b('.self::KNOWN_STUDIOS.')\b/i', strtolower($name)) || |
|
| 207 | 207 | preg_match('/\b(Hardcore|Porn|Sex|Anal|Creampie|MILF|Lesbian|Teen|Interracial)\b/i', $name); |
| 208 | 208 | |
| 209 | 209 | if (!$hasAdultMarker) { |
@@ -234,12 +234,12 @@ discard block |
||
| 234 | 234 | $hasHD = preg_match('/\b(720p|1080p|2160p|HD|4K)\b/i', $name); |
| 235 | 235 | |
| 236 | 236 | // Studio + performer + HD resolution |
| 237 | - if (preg_match('/^(' . self::KNOWN_STUDIOS . ')\.([A-Z][a-z]+).*?(720p|1080p|2160p|HD|4K)/i', $name)) { |
|
| 237 | + if (preg_match('/^('.self::KNOWN_STUDIOS.')\.([A-Z][a-z]+).*?(720p|1080p|2160p|HD|4K)/i', $name)) { |
|
| 238 | 238 | return $this->matched(Category::XXX_CLIPHD, 0.9, 'clip_hd_studio'); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | // Known studio with date pattern: site.YYYY.MM.DD or site.YY.MM.DD |
| 242 | - if (preg_match('/^(' . self::KNOWN_STUDIOS . ')[.\-_ ](19|20)?\d{2}[.\-_ ]\d{2}[.\-_ ]\d{2}/i', $name)) { |
|
| 242 | + if (preg_match('/^('.self::KNOWN_STUDIOS.')[.\-_ ](19|20)?\d{2}[.\-_ ]\d{2}[.\-_ ]\d{2}/i', $name)) { |
|
| 243 | 243 | if ($hasHD) { |
| 244 | 244 | return $this->matched(Category::XXX_CLIPHD, 0.95, 'clip_hd_studio_date'); |
| 245 | 245 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if (preg_match('/^([A-Z][a-zA-Z0-9]+)[.\-_ ](19|20)\d{2}[.\-_ ]\d{2}[.\-_ ]\d{2}[.\-_ ]/i', $name) && |
| 252 | 252 | !preg_match('/\b(S\d{2}E\d{2}|Documentary|Series)\b/i', $name)) { |
| 253 | 253 | // Check if it has adult keywords or HD resolution |
| 254 | - if ($hasHD || preg_match('/\b(' . self::ADULT_KEYWORDS . ')\b/i', $name)) { |
|
| 254 | + if ($hasHD || preg_match('/\b('.self::ADULT_KEYWORDS.')\b/i', $name)) { |
|
| 255 | 255 | return $this->matched(Category::XXX_CLIPHD, 0.85, 'clip_hd_date_4digit'); |
| 256 | 256 | } |
| 257 | 257 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | // JAV compact date pattern: site.YYMMDD (e.g., 10musume.121025) |
| 266 | - if (preg_match('/^(' . self::KNOWN_STUDIOS . ')[.\-_ ](\d{6})/i', $name)) { |
|
| 266 | + if (preg_match('/^('.self::KNOWN_STUDIOS.')[.\-_ ](\d{6})/i', $name)) { |
|
| 267 | 267 | if ($hasHD) { |
| 268 | 268 | return $this->matched(Category::XXX_CLIPHD, 0.9, 'clip_hd_jav_date'); |
| 269 | 269 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | // Known studio with XXX marker and HD resolution |
| 274 | - if (preg_match('/^(' . self::KNOWN_STUDIOS . ')[.\-_ ].*\bXXX\b.*?(720p|1080p|2160p|HD|4K)/i', $name)) { |
|
| 274 | + if (preg_match('/^('.self::KNOWN_STUDIOS.')[.\-_ ].*\bXXX\b.*?(720p|1080p|2160p|HD|4K)/i', $name)) { |
|
| 275 | 275 | return $this->matched(Category::XXX_CLIPHD, 0.9, 'clip_hd_studio_xxx'); |
| 276 | 276 | } |
| 277 | 277 | |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | if (preg_match('/web[._ -]dl|web-?rip/i', $name) && |
| 326 | - (preg_match('/\b(' . self::ADULT_KEYWORDS . ')\b/i', $name) || |
|
| 327 | - preg_match('/\b(' . self::KNOWN_STUDIOS . ')\b/i', $name) || |
|
| 326 | + (preg_match('/\b('.self::ADULT_KEYWORDS.')\b/i', $name) || |
|
| 327 | + preg_match('/\b('.self::KNOWN_STUDIOS.')\b/i', $name) || |
|
| 328 | 328 | preg_match('/\b(XXX|Porn|Adult|JAV|Hentai)\b/i', $name))) { |
| 329 | 329 | return $this->matched(Category::XXX_WEBDL, 0.85, 'webdl'); |
| 330 | 330 | } |