@@ -107,7 +107,7 @@ |
||
| 107 | 107 | protected function generic(): array |
| 108 | 108 | { |
| 109 | 109 | // For non music groups. |
| 110 | - if (! preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) { |
|
| 110 | + if (!preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) { |
|
| 111 | 111 | // File/part count. |
| 112 | 112 | // File extensions. |
| 113 | 113 | // File extensions - If it was not in quotes. |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | { |
| 276 | 276 | $browseBy = ' '; |
| 277 | 277 | foreach ($this->getBrowseByOptions() as $bbk => $bbv) { |
| 278 | - if (! empty($_REQUEST[$bbk])) { |
|
| 278 | + if (!empty($_REQUEST[$bbk])) { |
|
| 279 | 279 | $bbs = stripslashes($_REQUEST[$bbk]); |
| 280 | 280 | $browseBy .= ' AND con.'.$bbv.' LIKE '.escapeString('%'.$bbs.'%'); |
| 281 | 281 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $con['esrb'] = (string) $amaz->ItemAttributes->ESRBAgeRating; |
| 401 | 401 | $con['releasedate'] = (string) $amaz->ItemAttributes->ReleaseDate; |
| 402 | 402 | |
| 403 | - if (! isset($con['releasedate'])) { |
|
| 403 | + if (!isset($con['releasedate'])) { |
|
| 404 | 404 | $con['releasedate'] = ''; |
| 405 | 405 | } |
| 406 | 406 | |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | if (config('config.credentials.client_id') !== '' && config('config.credentials.client_secret') !== '') { |
| 629 | 629 | try { |
| 630 | 630 | $result = Game::where('name', $gameInfo)->get(); |
| 631 | - if (! empty($result)) { |
|
| 631 | + if (!empty($result)) { |
|
| 632 | 632 | $bestMatchPct = 0; |
| 633 | 633 | foreach ($result as $res) { |
| 634 | 634 | similar_text(strtolower($gameInfo), strtolower($res->name), $percent); |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | ])->where('id', $bestMatch)->first(); |
| 647 | 647 | |
| 648 | 648 | $publishers = []; |
| 649 | - if (! empty($game->involved_companies)) { |
|
| 649 | + if (!empty($game->involved_companies)) { |
|
| 650 | 650 | foreach ($game->involved_companies as $publisher) { |
| 651 | 651 | if ($publisher['publisher'] === true) { |
| 652 | 652 | $company = Company::find($publisher['company']); |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $genres = []; |
| 659 | 659 | |
| 660 | - if (! empty($game->themes)) { |
|
| 660 | + if (!empty($game->themes)) { |
|
| 661 | 661 | foreach ($game->themes as $theme) { |
| 662 | 662 | $genres[] = $theme['name']; |
| 663 | 663 | } |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | |
| 668 | 668 | $platform = ''; |
| 669 | 669 | |
| 670 | - if (! empty($game->platforms)) { |
|
| 670 | + if (!empty($game->platforms)) { |
|
| 671 | 671 | foreach ($game->platforms as $platforms) { |
| 672 | 672 | $percentCurrent = 0; |
| 673 | 673 | $gamePlatforms = Platform::where('id', $platforms)->get(); |
@@ -686,13 +686,13 @@ discard block |
||
| 686 | 686 | 'title' => $game->name, |
| 687 | 687 | 'asin' => $game->id, |
| 688 | 688 | 'review' => $game->summary ?? '', |
| 689 | - 'coverurl' => ! empty($game->cover->url) ? 'https:'.$game->cover->url : '', |
|
| 690 | - 'releasedate' => ! empty($game->first_release_date) ? $game->first_release_date->format('Y-m-d') : now()->format('Y-m-d'), |
|
| 691 | - 'esrb' => ! empty($game->aggregated_rating) ? round($game->aggregated_rating).'%' : 'Not Rated', |
|
| 689 | + 'coverurl' => !empty($game->cover->url) ? 'https:'.$game->cover->url : '', |
|
| 690 | + 'releasedate' => !empty($game->first_release_date) ? $game->first_release_date->format('Y-m-d') : now()->format('Y-m-d'), |
|
| 691 | + 'esrb' => !empty($game->aggregated_rating) ? round($game->aggregated_rating).'%' : 'Not Rated', |
|
| 692 | 692 | 'url' => $game->url ?? '', |
| 693 | - 'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown', |
|
| 693 | + 'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown', |
|
| 694 | 694 | 'platform' => $platform ?? '', |
| 695 | - 'consolegenre' => ! empty($genres) ? implode(',', $genres) : 'Unknown', |
|
| 695 | + 'consolegenre' => !empty($genres) ? implode(',', $genres) : 'Unknown', |
|
| 696 | 696 | 'consolegenreid' => $genreKey ?? '', |
| 697 | 697 | 'salesrank' => '', |
| 698 | 698 | ]; |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | $platform = 'PSX'; |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | - if (! empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) { |
|
| 838 | + if (!empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) { |
|
| 839 | 839 | $platform = 'XBOX360'; |
| 840 | 840 | } |
| 841 | 841 | |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | Other option is to pass the $release->categories_id here if we don't find a platform but that |
| 851 | 851 | would require an extra lookup to determine the name. In either case we should have a title at the minimum. */ |
| 852 | 852 | |
| 853 | - return (isset($result['title'], $result['platform']) && ! empty($result['title'])) ? $result : false; |
|
| 853 | + return (isset($result['title'], $result['platform']) && !empty($result['title'])) ? $result : false; |
|
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | public function getBrowseNode($platform): string |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | $audios = $arrXml->getAudios(); |
| 107 | 107 | $videos = $arrXml->getVideos(); |
| 108 | 108 | $subtitles = $arrXml->getSubtitles(); |
| 109 | - if (! empty($general)) { |
|
| 110 | - if (! empty($general->get('unique_id')) && (int) $general->get('unique_id')->getShortName() !== 1) { |
|
| 109 | + if (!empty($general)) { |
|
| 110 | + if (!empty($general->get('unique_id')) && (int) $general->get('unique_id')->getShortName() !== 1) { |
|
| 111 | 111 | $uniqueId = $general->get('unique_id')->getShortName(); |
| 112 | 112 | $this->addUID($releaseID, $uniqueId); |
| 113 | 113 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $videoDuration = $videoFormat = $videoCodec = $videoWidth = $videoHeight = $videoAspect = $videoFrameRate = $videoLibrary = $videoBitRate = ''; |
| 124 | 124 | |
| 125 | - if (! empty($videos)) { |
|
| 125 | + if (!empty($videos)) { |
|
| 126 | 126 | foreach ($videos as $video) { |
| 127 | 127 | if ($video->get('duration') !== null) { |
| 128 | 128 | $videoDuration = $video->get('duration')->getMilliseconds(); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $videoBitRate = $video->get('nominal_bit_rate')->getTextValue(); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - if (! empty($videoBitRate)) { |
|
| 171 | + if (!empty($videoBitRate)) { |
|
| 172 | 172 | $overallBitRate = $videoBitRate; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $audioID = 1; |
| 180 | 180 | $audioFormat = $audioMode = $audioBitRateMode = $audioBitRate = $audioChannels = $audioSampleRate = $audioLibrary = $audioLanguage = $audioTitle = ''; |
| 181 | 181 | |
| 182 | - if (! empty($audios)) { |
|
| 182 | + if (!empty($audios)) { |
|
| 183 | 183 | foreach ($audios as $audio) { |
| 184 | 184 | if ($audio->get('id') !== null) { |
| 185 | 185 | $audioID = $audio->get('id')->getFullName(); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - if (! empty($subtitles)) { |
|
| 228 | + if (!empty($subtitles)) { |
|
| 229 | 229 | foreach ($subtitles as $subtitle) { |
| 230 | 230 | $subsID = 1; |
| 231 | 231 | $subsLanguage = 'Unknown'; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | 'audiochannels' => \is_array($audioChannels) ? implode($audioChannels) : $audioChannels, |
| 290 | 290 | 'audiosamplerate' => \is_array($audioSampleRate) ? implode($audioSampleRate) : $audioSampleRate, |
| 291 | 291 | 'audiolibrary' => \is_array($audioLibrary) ? implode($audioLibrary) : $audioLibrary, |
| 292 | - 'audiolanguage' => ! empty($audioLanguage) ? $audioLanguage[1] : '', |
|
| 292 | + 'audiolanguage' => !empty($audioLanguage) ? $audioLanguage[1] : '', |
|
| 293 | 293 | 'audiotitle' => \is_array($audioTitle) ? implode($audioTitle) : $audioTitle, |
| 294 | 294 | ]); |
| 295 | 295 | } |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | $ckid = ReleaseSubtitle::query()->where('releases_id', $releaseID)->first(['releases_id']); |
| 301 | 301 | $subs = ''; |
| 302 | - if (! empty($subsLanguage)) { |
|
| 303 | - if (! empty($subsLanguage[1])) { |
|
| 302 | + if (!empty($subsLanguage)) { |
|
| 303 | + if (!empty($subsLanguage[1])) { |
|
| 304 | 304 | $subs = $subsLanguage[1]; |
| 305 | - } elseif (! empty($subsLanguage[0])) { |
|
| 305 | + } elseif (!empty($subsLanguage[0])) { |
|
| 306 | 306 | $subs = $subsLanguage[0]; |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function deleteRegex(int $id): void |
| 151 | 151 | { |
| 152 | - DB::transaction(function () use ($id) { |
|
| 152 | + DB::transaction(function() use ($id) { |
|
| 153 | 153 | DB::delete(sprintf('DELETE FROM %s WHERE id = %d', $this->tableName, $id)); |
| 154 | 154 | }, 3); |
| 155 | 155 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | { |
| 167 | 167 | $groupID = UsenetGroup::getIDByName($groupName); |
| 168 | 168 | |
| 169 | - if (! $groupID) { |
|
| 169 | + if (!$groupID) { |
|
| 170 | 170 | return []; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | ksort($hits); |
| 189 | 189 | $string = $string2 = ''; |
| 190 | 190 | foreach ($hits as $key => $hit) { |
| 191 | - if (! \is_int($key)) { |
|
| 191 | + if (!\is_int($key)) { |
|
| 192 | 192 | $string .= $hit; |
| 193 | 193 | $string2 .= '<br/>'.$key.': '.$hit; |
| 194 | 194 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | $groupID = UsenetGroup::getIDByName($groupName); |
| 229 | 229 | |
| 230 | - if (! $groupID) { |
|
| 230 | + if (!$groupID) { |
|
| 231 | 231 | return []; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | public function beginImport($filesToProcess, $useNzbName = false, $delete = true, $deleteFailed = true) |
| 108 | 108 | { |
| 109 | 109 | // Get all the groups in the DB. |
| 110 | - if (! $this->getAllGroups()) { |
|
| 110 | + if (!$this->getAllGroups()) { |
|
| 111 | 111 | if ($this->browser) { |
| 112 | 112 | return $this->retVal; |
| 113 | 113 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | gzwrite($fp, $nzbString); |
| 168 | 168 | gzclose($fp); |
| 169 | 169 | |
| 170 | - if (! File::isFile($path)) { |
|
| 170 | + if (!File::isFile($path)) { |
|
| 171 | 171 | $this->echoOut('ERROR: Problem compressing NZB file to: '.$path); |
| 172 | 172 | |
| 173 | 173 | // Remove the release. |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | if ($groupID === -1) { |
| 256 | 256 | if (array_key_exists($group, $this->allGroups)) { |
| 257 | 257 | $groupID = $this->allGroups[$group]; |
| 258 | - if (! $groupName) { |
|
| 258 | + if (!$groupName) { |
|
| 259 | 259 | $groupName = $group; |
| 260 | 260 | } |
| 261 | 261 | } else { |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | // If we found a group and it's not blacklisted. |
| 292 | - if ($groupID !== -1 && ! $isBlackListed) { |
|
| 292 | + if ($groupID !== -1 && !$isBlackListed) { |
|
| 293 | 293 | // Get the size of the release. |
| 294 | 294 | if (\count($file->segments->segment) > 0) { |
| 295 | 295 | foreach ($file->segments->segment as $segment) { |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | return 0; |
| 135 | 135 | } |
| 136 | 136 | // Check if it's on the drive. |
| 137 | - if (! File::isReadable($coverPath)) { |
|
| 137 | + if (!File::isReadable($coverPath)) { |
|
| 138 | 138 | return 0; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if (\in_array($siteColumn, self::$sites, false)) { |
| 101 | 101 | $result = Video::query()->where($siteColumn, $siteID)->first(); |
| 102 | 102 | } |
| 103 | - if (! empty($result)) { |
|
| 103 | + if (!empty($result)) { |
|
| 104 | 104 | $query = $result->toArray(); |
| 105 | 105 | |
| 106 | 106 | return $query['id']; |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | public function getTitleExact(string $title, int $type, int $source = 0): int |
| 181 | 181 | { |
| 182 | 182 | $return = 0; |
| 183 | - if (! empty($title)) { |
|
| 183 | + if (!empty($title)) { |
|
| 184 | 184 | $sql = Video::query()->where(['title' => $title, 'type' => $type]); |
| 185 | 185 | if ($source > 0) { |
| 186 | 186 | $sql->where('source', $source); |
| 187 | 187 | } |
| 188 | 188 | $query = $sql->first(); |
| 189 | - if (! empty($query)) { |
|
| 189 | + if (!empty($query)) { |
|
| 190 | 190 | $result = $query->toArray(); |
| 191 | 191 | $return = $result['id']; |
| 192 | 192 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $sql->where('videos.source', $source); |
| 200 | 200 | } |
| 201 | 201 | $query = $sql->first(); |
| 202 | - if (! empty($query)) { |
|
| 202 | + if (!empty($query)) { |
|
| 203 | 203 | $result = $query->toArray(); |
| 204 | 204 | $return = $result['id']; |
| 205 | 205 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | $return = 0; |
| 218 | 218 | |
| 219 | - if (! empty($title)) { |
|
| 219 | + if (!empty($title)) { |
|
| 220 | 220 | $sql = Video::query() |
| 221 | 221 | ->where('title', 'like', rtrim($title, '%')) |
| 222 | 222 | ->where('type', $type); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $sql->where('source', $source); |
| 225 | 225 | } |
| 226 | 226 | $query = $sql->first(); |
| 227 | - if (! empty($query)) { |
|
| 227 | + if (!empty($query)) { |
|
| 228 | 228 | $result = $query->toArray(); |
| 229 | 229 | $return = $result['id']; |
| 230 | 230 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $sql->where('videos.source', $source); |
| 239 | 239 | } |
| 240 | 240 | $query = $sql->first(); |
| 241 | - if (! empty($query)) { |
|
| 241 | + if (!empty($query)) { |
|
| 242 | 242 | $result = $query->toArray(); |
| 243 | 243 | $return = $result['id']; |
| 244 | 244 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | public function getAlternativeTitleExact(string $title, int $type, int $source = 0): mixed |
| 255 | 255 | { |
| 256 | 256 | $return = 0; |
| 257 | - if (! empty($title)) { |
|
| 257 | + if (!empty($title)) { |
|
| 258 | 258 | if ($source > 0) { |
| 259 | 259 | $query = Video::query() |
| 260 | 260 | ->whereRaw("REPLACE(title,'\'','') = ?", $title) |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | ->where('type', '=', $type) |
| 270 | 270 | ->first(); |
| 271 | 271 | } |
| 272 | - if (! empty($query)) { |
|
| 272 | + if (!empty($query)) { |
|
| 273 | 273 | $result = $query->toArray(); |
| 274 | 274 | |
| 275 | 275 | return $result['id']; |
@@ -284,10 +284,10 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | public function addAliases($videoId, array $aliases = []): void |
| 286 | 286 | { |
| 287 | - if (! empty($aliases) && $videoId > 0) { |
|
| 287 | + if (!empty($aliases) && $videoId > 0) { |
|
| 288 | 288 | foreach ($aliases as $key => $title) { |
| 289 | 289 | // Check for tvmaze style aka |
| 290 | - if (\is_array($title) && ! empty($title['name'])) { |
|
| 290 | + if (\is_array($title) && !empty($title['name'])) { |
|
| 291 | 291 | $title = $title['name']; |
| 292 | 292 | } |
| 293 | 293 | // Check if we have the AKA already |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | |
| 275 | 275 | // Loop through the files. |
| 276 | 276 | foreach ($files as $file) { |
| 277 | - if (! isset($file['name'])) { |
|
| 277 | + if (!isset($file['name'])) { |
|
| 278 | 278 | continue; |
| 279 | 279 | } |
| 280 | 280 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | // Check for show aliases and try match those too |
| 268 | - if (\is_array($show->akas) && ! empty($show->akas)) { |
|
| 268 | + if (\is_array($show->akas) && !empty($show->akas)) { |
|
| 269 | 269 | foreach ($show->akas as $key => $aka) { |
| 270 | 270 | $matchPercent = $this->checkMatch(strtolower($aka['name']), strtolower($cleanName), $matchPercent); |
| 271 | 271 | if ($matchPercent > $highestMatch) { |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | $hasCover = 0; |
| 296 | 296 | |
| 297 | 297 | // Try to get the Poster |
| 298 | - if (! empty($this->posterUrl)) { |
|
| 298 | + if (!empty($this->posterUrl)) { |
|
| 299 | 299 | $hasCover = $ri->saveImage($videoId, $this->posterUrl, $this->imgSavePath); |
| 300 | 300 | |
| 301 | 301 | // Mark it retrieved if we saved an image |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | 'trakt' => 0, |
| 367 | 367 | 'tvrage' => (int) ($show->externalIDs['tvrage'] ?? 0), |
| 368 | 368 | 'tmdb' => 0, |
| 369 | - 'aliases' => ! empty($show->akas) ? (array) $show->akas : '', |
|
| 369 | + 'aliases' => !empty($show->akas) ? (array) $show->akas : '', |
|
| 370 | 370 | 'localzone' => "''", |
| 371 | 371 | ]; |
| 372 | 372 | } |