@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $this->echoCLI = config('nntmux.echocli'); |
111 | 111 | $groupID = ''; |
112 | 112 | |
113 | - if (! empty($groupName)) { |
|
113 | + if (!empty($groupName)) { |
|
114 | 114 | $groupInfo = UsenetGroup::getByName($groupName); |
115 | 115 | if ($groupInfo !== null) { |
116 | 116 | $groupID = $groupInfo['id']; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $this->colorCLI->header('Starting release update process ('.now()->format('Y-m-d H:i:s').')'); |
122 | 122 | } |
123 | 123 | |
124 | - if (! file_exists(Settings::settingValue('..nzbpath'))) { |
|
124 | + if (!file_exists(Settings::settingValue('..nzbpath'))) { |
|
125 | 125 | if ($this->echoCLI) { |
126 | 126 | $this->colorCLI->error('Bad or missing nzb directory - '.Settings::settingValue('..nzbpath')); |
127 | 127 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $cat = new Categorize(); |
183 | 183 | $categorized = $total = 0; |
184 | 184 | $releasesQuery = Release::query()->where(['categories_id' => Category::OTHER_MISC, 'iscategorized' => 0]); |
185 | - if (! empty($groupId)) { |
|
185 | + if (!empty($groupId)) { |
|
186 | 186 | $releasesQuery->where('groups_id', $groupId); |
187 | 187 | } |
188 | 188 | $releases = $releasesQuery->select(['id', 'fromname', 'groups_id', $type])->get(); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $this->colorCLI->header('Process Releases -> Attempting to find complete collections.'); |
219 | 219 | } |
220 | 220 | |
221 | - $where = (! empty($groupID) ? ' AND c.groups_id = '.$groupID.' ' : ' '); |
|
221 | + $where = (!empty($groupID) ? ' AND c.groups_id = '.$groupID.' ' : ' '); |
|
222 | 222 | |
223 | 223 | $this->processStuckCollections($groupID); |
224 | 224 | $this->collectionFileCheckStage1($groupID); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | if ($this->echoCLI) { |
232 | 232 | $countQuery = Collection::query()->where('filecheck', self::COLLFC_COMPPART); |
233 | 233 | |
234 | - if (! empty($groupID)) { |
|
234 | + if (!empty($groupID)) { |
|
235 | 235 | $countQuery->where('groups_id', $groupID); |
236 | 236 | } |
237 | 237 | $count = $countQuery->count('id'); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $this->colorCLI->header('Process Releases -> Calculating collection sizes (in bytes).'); |
259 | 259 | } |
260 | 260 | // Get the total size in bytes of the collection for collections where filecheck = 2. |
261 | - DB::transaction(function () use ($groupID, $startTime) { |
|
261 | + DB::transaction(function() use ($groupID, $startTime) { |
|
262 | 262 | $checked = DB::update( |
263 | 263 | sprintf( |
264 | 264 | ' |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | AND c.filesize = 0 %s', |
275 | 275 | self::COLLFC_SIZED, |
276 | 276 | self::COLLFC_COMPPART, |
277 | - (! empty($groupID) ? ' AND c.groups_id = '.$groupID : ' ') |
|
277 | + (!empty($groupID) ? ' AND c.groups_id = '.$groupID : ' ') |
|
278 | 278 | ) |
279 | 279 | ); |
280 | 280 | if ($checked > 0 && $this->echoCLI) { |
@@ -313,16 +313,16 @@ discard block |
||
313 | 313 | |
314 | 314 | $groupMinimums = UsenetGroup::getGroupByID($grpID['id']); |
315 | 315 | if ($groupMinimums !== null) { |
316 | - if (! empty($groupMinimums['minsizetoformrelease']) && $groupMinimums['minsizetoformrelease'] > 0) { |
|
316 | + if (!empty($groupMinimums['minsizetoformrelease']) && $groupMinimums['minsizetoformrelease'] > 0) { |
|
317 | 317 | $groupMinSizeSetting = (int) $groupMinimums['minsizetoformrelease']; |
318 | 318 | } |
319 | - if (! empty($groupMinimums['minfilestoformrelease']) && $groupMinimums['minfilestoformrelease'] > 0) { |
|
319 | + if (!empty($groupMinimums['minfilestoformrelease']) && $groupMinimums['minfilestoformrelease'] > 0) { |
|
320 | 320 | $groupMinFilesSetting = (int) $groupMinimums['minfilestoformrelease']; |
321 | 321 | } |
322 | 322 | } |
323 | 323 | |
324 | 324 | if (Collection::query()->where('filecheck', self::COLLFC_SIZED)->where('filesize', '>', 0)->first() !== null) { |
325 | - DB::transaction(function () use ( |
|
325 | + DB::transaction(function() use ( |
|
326 | 326 | $groupMinSizeSetting, |
327 | 327 | $minSizeSetting, |
328 | 328 | $minSizeDeleted, |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $collectionsQuery = Collection::query() |
396 | 396 | ->where('collections.filecheck', self::COLLFC_SIZED) |
397 | 397 | ->where('collections.filesize', '>', 0); |
398 | - if (! empty($groupID)) { |
|
398 | + if (!empty($groupID)) { |
|
399 | 399 | $collectionsQuery->where('collections.groups_id', $groupID); |
400 | 400 | } |
401 | 401 | $collectionsQuery->select(['collections.*', 'usenet_groups.name as gname']) |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $releaseID = Release::insertRelease( |
451 | 451 | [ |
452 | 452 | 'name' => $cleanRelName, |
453 | - 'searchname' => ! empty($cleanedName) ? mb_convert_encoding($cleanedName, 'UTF-8', mb_list_encodings()) : $cleanRelName, |
|
453 | + 'searchname' => !empty($cleanedName) ? mb_convert_encoding($cleanedName, 'UTF-8', mb_list_encodings()) : $cleanRelName, |
|
454 | 454 | 'totalpart' => $collection->totalfiles, |
455 | 455 | 'groups_id' => $collection->groups_id, |
456 | 456 | 'guid' => createGUID(), |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | |
467 | 467 | if ($releaseID !== null) { |
468 | 468 | // Update collections table to say we inserted the release. |
469 | - DB::transaction(static function () use ($collection, $releaseID) { |
|
469 | + DB::transaction(static function() use ($collection, $releaseID) { |
|
470 | 470 | Collection::query()->where('id', $collection->id)->update(['filecheck' => self::COLLFC_INSERTED, 'releases_id' => $releaseID]); |
471 | 471 | }, 10); |
472 | 472 | |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | } |
528 | 528 | } else { |
529 | 529 | // The release was already in the DB, so delete the collection. |
530 | - DB::transaction(static function () use ($collection) { |
|
530 | + DB::transaction(static function() use ($collection) { |
|
531 | 531 | Collection::query()->where('collectionhash', $collection->collectionhash)->delete(); |
532 | 532 | }, 10); |
533 | 533 | |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | } |
569 | 569 | |
570 | 570 | $releasesQuery = Release::query()->with('category.parent')->where('nzbstatus', '=', 0); |
571 | - if (! empty($groupID)) { |
|
571 | + if (!empty($groupID)) { |
|
572 | 572 | $releasesQuery->where('releases.groups_id', $groupID); |
573 | 573 | } |
574 | 574 | $releases = $releasesQuery->select(['id', 'guid', 'name', 'categories_id'])->get(); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | ), true); |
672 | 672 | } |
673 | 673 | |
674 | - DB::transaction(function () use ($deletedCount, $startTime) { |
|
674 | + DB::transaction(function() use ($deletedCount, $startTime) { |
|
675 | 675 | $deleted = 0; |
676 | 676 | $deleteQuery = Collection::query() |
677 | 677 | ->where('dateadded', '<', now()->subHours(Settings::settingValue('..partretentionhours'))) |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | foreach ($genrelist as $genre) { |
887 | 887 | $musicInfoQuery = MusicInfo::query()->where('genre_id', (int) $genre['id'])->select(['id']); |
888 | 888 | $releases = Release::query() |
889 | - ->joinSub($musicInfoQuery, 'mi', function ($join) { |
|
889 | + ->joinSub($musicInfoQuery, 'mi', function($join) { |
|
890 | 890 | $join->on('releases.musicinfo_id', '=', 'mi.id'); |
891 | 891 | }) |
892 | 892 | ->select(['releases.id', 'releases.guid']) |
@@ -972,18 +972,18 @@ discard block |
||
972 | 972 | */ |
973 | 973 | private function collectionFileCheckStage1(int $groupID): void |
974 | 974 | { |
975 | - DB::transaction(static function () use ($groupID) { |
|
975 | + DB::transaction(static function() use ($groupID) { |
|
976 | 976 | $collectionsCheck = Collection::query()->select(['collections.id']) |
977 | 977 | ->join('binaries', 'binaries.collections_id', '=', 'collections.id') |
978 | 978 | ->where('collections.totalfiles', '>', 0) |
979 | 979 | ->where('collections.filecheck', '=', self::COLLFC_DEFAULT); |
980 | - if (! empty($groupID)) { |
|
980 | + if (!empty($groupID)) { |
|
981 | 981 | $collectionsCheck->where('collections.groups_id', $groupID); |
982 | 982 | } |
983 | 983 | $collectionsCheck->groupBy('binaries.collections_id', 'collections.totalfiles', 'collections.id') |
984 | 984 | ->havingRaw('COUNT(binaries.id) IN (collections.totalfiles, collections.totalfiles+1)'); |
985 | 985 | |
986 | - Collection::query()->joinSub($collectionsCheck, 'r', function ($join) { |
|
986 | + Collection::query()->joinSub($collectionsCheck, 'r', function($join) { |
|
987 | 987 | $join->on('collections.id', '=', 'r.id'); |
988 | 988 | })->update(['collections.filecheck' => self::COLLFC_COMPCOLL]); |
989 | 989 | }, 10); |
@@ -1004,25 +1004,25 @@ discard block |
||
1004 | 1004 | */ |
1005 | 1005 | private function collectionFileCheckStage2(int $groupID): void |
1006 | 1006 | { |
1007 | - DB::transaction(static function () use ($groupID) { |
|
1007 | + DB::transaction(static function() use ($groupID) { |
|
1008 | 1008 | $collectionsCheck = Collection::query()->select(['collections.id']) |
1009 | 1009 | ->join('binaries', 'binaries.collections_id', '=', 'collections.id') |
1010 | 1010 | ->where('binaries.filenumber', '=', 0) |
1011 | 1011 | ->where('collections.totalfiles', '>', 0) |
1012 | 1012 | ->where('collections.filecheck', '=', self::COLLFC_COMPCOLL); |
1013 | - if (! empty($groupID)) { |
|
1013 | + if (!empty($groupID)) { |
|
1014 | 1014 | $collectionsCheck->where('collections.groups_id', $groupID); |
1015 | 1015 | } |
1016 | 1016 | $collectionsCheck->groupBy('collections.id'); |
1017 | 1017 | |
1018 | - Collection::query()->joinSub($collectionsCheck, 'r', function ($join) { |
|
1018 | + Collection::query()->joinSub($collectionsCheck, 'r', function($join) { |
|
1019 | 1019 | $join->on('collections.id', '=', 'r.id'); |
1020 | 1020 | })->update(['collections.filecheck' => self::COLLFC_ZEROPART]); |
1021 | 1021 | }, 10); |
1022 | 1022 | |
1023 | - DB::transaction(static function () use ($groupID) { |
|
1023 | + DB::transaction(static function() use ($groupID) { |
|
1024 | 1024 | $collectionQuery = Collection::query()->where('filecheck', '=', self::COLLFC_COMPCOLL); |
1025 | - if (! empty($groupID)) { |
|
1025 | + if (!empty($groupID)) { |
|
1026 | 1026 | $collectionQuery->where('groups_id', $groupID); |
1027 | 1027 | } |
1028 | 1028 | $collectionQuery->update(['filecheck' => self::COLLFC_TEMPCOMP]); |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | */ |
1041 | 1041 | private function collectionFileCheckStage3(string $where): void |
1042 | 1042 | { |
1043 | - DB::transaction(static function () use ($where) { |
|
1043 | + DB::transaction(static function() use ($where) { |
|
1044 | 1044 | DB::update( |
1045 | 1045 | sprintf( |
1046 | 1046 | ' |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | ); |
1065 | 1065 | }, 10); |
1066 | 1066 | |
1067 | - DB::transaction(static function () use ($where) { |
|
1067 | + DB::transaction(static function() use ($where) { |
|
1068 | 1068 | DB::update( |
1069 | 1069 | sprintf( |
1070 | 1070 | ' |
@@ -1101,7 +1101,7 @@ discard block |
||
1101 | 1101 | */ |
1102 | 1102 | private function collectionFileCheckStage4(string &$where): void |
1103 | 1103 | { |
1104 | - DB::transaction(static function () use ($where) { |
|
1104 | + DB::transaction(static function() use ($where) { |
|
1105 | 1105 | DB::update( |
1106 | 1106 | sprintf( |
1107 | 1107 | ' |
@@ -1131,9 +1131,9 @@ discard block |
||
1131 | 1131 | */ |
1132 | 1132 | private function collectionFileCheckStage5(int $groupId): void |
1133 | 1133 | { |
1134 | - DB::transaction(static function () use ($groupId) { |
|
1134 | + DB::transaction(static function() use ($groupId) { |
|
1135 | 1135 | $collectionQuery = Collection::query()->whereIn('filecheck', [self::COLLFC_TEMPCOMP, self::COLLFC_ZEROPART]); |
1136 | - if (! empty($groupId)) { |
|
1136 | + if (!empty($groupId)) { |
|
1137 | 1137 | $collectionQuery->where('groups_id', $groupId); |
1138 | 1138 | } |
1139 | 1139 | $collectionQuery->update(['filecheck' => self::COLLFC_COMPCOLL]); |
@@ -1151,7 +1151,7 @@ discard block |
||
1151 | 1151 | */ |
1152 | 1152 | private function collectionFileCheckStage6(string &$where): void |
1153 | 1153 | { |
1154 | - DB::transaction(function () use ($where) { |
|
1154 | + DB::transaction(function() use ($where) { |
|
1155 | 1155 | DB::update( |
1156 | 1156 | sprintf( |
1157 | 1157 | " |
@@ -1181,10 +1181,10 @@ discard block |
||
1181 | 1181 | { |
1182 | 1182 | $lastRun = Settings::settingValue('indexer.processing.last_run_time'); |
1183 | 1183 | |
1184 | - DB::transaction(function () use ($groupID, $lastRun) { |
|
1184 | + DB::transaction(function() use ($groupID, $lastRun) { |
|
1185 | 1185 | $objQuery = Collection::query() |
1186 | 1186 | ->where('added', '<', Carbon::createFromFormat('Y-m-d H:i:s', $lastRun)->subHours($this->collectionTimeout)); |
1187 | - if (! empty($groupID)) { |
|
1187 | + if (!empty($groupID)) { |
|
1188 | 1188 | $objQuery->where('groups_id', $groupID); |
1189 | 1189 | } |
1190 | 1190 | $obj = $objQuery->delete(); |
@@ -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 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | sleep(1); |
197 | 197 | |
198 | - if (\is_array($response) && ! empty($response['results'])) { |
|
198 | + if (\is_array($response) && !empty($response['results'])) { |
|
199 | 199 | $return = $this->matchShowInfo($response['results'], $name); |
200 | 200 | } |
201 | 201 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | } |
230 | 230 | } |
231 | - if (! empty($highest)) { |
|
231 | + if (!empty($highest)) { |
|
232 | 232 | try { |
233 | 233 | $showAlternativeTitles = TmdbClient::getTvApi()->getAlternativeTitles($highest['id']); |
234 | 234 | } catch (TmdbApiException $e) { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $hascover = 0; |
266 | 266 | |
267 | 267 | // Try to get the Poster |
268 | - if (! empty($this->posterUrl)) { |
|
268 | + if (!empty($this->posterUrl)) { |
|
269 | 269 | $hascover = $ri->saveImage($videoId, $this->posterUrl, $this->imgSavePath); |
270 | 270 | |
271 | 271 | // Mark it retrieved if we saved an image |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | 'tvrage' => isset($show['external_ids']['tvrage_id']) ? (int) $show['external_ids']['tvrage_id'] : 0, |
330 | 330 | 'tvmaze' => 0, |
331 | 331 | 'tmdb' => (int) $show['id'], |
332 | - 'aliases' => ! empty($show['alternative_titles']) ? (array) $show['alternative_titles'] : '', |
|
332 | + 'aliases' => !empty($show['alternative_titles']) ? (array) $show['alternative_titles'] : '', |
|
333 | 333 | 'localzone' => "''", |
334 | 334 | ]; |
335 | 335 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | if (\is_array($response)) { |
257 | 257 | foreach ($response as $show) { |
258 | - if (! is_bool($show)) { |
|
258 | + if (!is_bool($show)) { |
|
259 | 259 | // Check for exact title match first and then terminate if found |
260 | 260 | if ($show['show']['title'] === $name) { |
261 | 261 | $highest = $show; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | 'tvrage' => $show['ids']['tvrage'] ?? 0, |
309 | 309 | 'tvmaze' => 0, |
310 | 310 | 'tmdb' => $show['ids']['tmdb'] ?? 0, |
311 | - 'aliases' => isset($show['aliases']) && ! empty($show['aliases']) ? (array) $show['aliases'] : '', |
|
311 | + 'aliases' => isset($show['aliases']) && !empty($show['aliases']) ? (array) $show['aliases'] : '', |
|
312 | 312 | 'localzone' => $this->localizedTZ, |
313 | 313 | ]; |
314 | 314 | } |
@@ -20,33 +20,33 @@ discard block |
||
20 | 20 | abstract class TV extends Videos |
21 | 21 | { |
22 | 22 | // Television Sources |
23 | - protected const SOURCE_NONE = 0; // No Scrape source |
|
23 | + protected const SOURCE_NONE = 0; // No Scrape source |
|
24 | 24 | |
25 | - protected const SOURCE_TVDB = 1; // Scrape source was TVDB |
|
25 | + protected const SOURCE_TVDB = 1; // Scrape source was TVDB |
|
26 | 26 | |
27 | - protected const SOURCE_TVMAZE = 2; // Scrape source was TVMAZE |
|
27 | + protected const SOURCE_TVMAZE = 2; // Scrape source was TVMAZE |
|
28 | 28 | |
29 | - protected const SOURCE_TMDB = 3; // Scrape source was TMDB |
|
29 | + protected const SOURCE_TMDB = 3; // Scrape source was TMDB |
|
30 | 30 | |
31 | - protected const SOURCE_TRAKT = 4; // Scrape source was Trakt |
|
31 | + protected const SOURCE_TRAKT = 4; // Scrape source was Trakt |
|
32 | 32 | |
33 | - protected const SOURCE_IMDB = 5; // Scrape source was IMDB |
|
33 | + protected const SOURCE_IMDB = 5; // Scrape source was IMDB |
|
34 | 34 | |
35 | 35 | // Anime Sources |
36 | - protected const SOURCE_ANIDB = 10; // Scrape source was AniDB |
|
36 | + protected const SOURCE_ANIDB = 10; // Scrape source was AniDB |
|
37 | 37 | |
38 | 38 | // Processing signifiers |
39 | - protected const PROCESS_TVDB = 0; // Process TVDB First |
|
39 | + protected const PROCESS_TVDB = 0; // Process TVDB First |
|
40 | 40 | |
41 | - protected const PROCESS_TVMAZE = -1; // Process TVMaze Second |
|
41 | + protected const PROCESS_TVMAZE = -1; // Process TVMaze Second |
|
42 | 42 | |
43 | - protected const PROCESS_TMDB = -2; // Process TMDB Third |
|
43 | + protected const PROCESS_TMDB = -2; // Process TMDB Third |
|
44 | 44 | |
45 | - protected const PROCESS_TRAKT = -3; // Process Trakt Fourth |
|
45 | + protected const PROCESS_TRAKT = -3; // Process Trakt Fourth |
|
46 | 46 | |
47 | - protected const PROCESS_IMDB = -4; // Process IMDB Fifth |
|
47 | + protected const PROCESS_IMDB = -4; // Process IMDB Fifth |
|
48 | 48 | |
49 | - protected const NO_MATCH_FOUND = -6; // Failed All Methods |
|
49 | + protected const NO_MATCH_FOUND = -6; // Failed All Methods |
|
50 | 50 | |
51 | 51 | protected const FAILED_PARSE = -100; // Failed Parsing |
52 | 52 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | 'localzone' => $show['localzone'], |
221 | 221 | ]); |
222 | 222 | // If we have AKAs\aliases, insert those as well |
223 | - if (! empty($show['aliases'])) { |
|
223 | + if (!empty($show['aliases'])) { |
|
224 | 224 | $this->addAliases($videoId, $show['aliases']); |
225 | 225 | } |
226 | 226 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $videoId |
285 | 285 | ) |
286 | 286 | ); |
287 | - if (! empty($show['aliases'])) { |
|
287 | + if (!empty($show['aliases'])) { |
|
288 | 288 | $this->addAliases($videoId, $show['aliases']); |
289 | 289 | } |
290 | 290 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function delete(int $id): mixed |
296 | 296 | { |
297 | - return DB::transaction(function () use ($id) { |
|
297 | + return DB::transaction(function() use ($id) { |
|
298 | 298 | DB::delete( |
299 | 299 | sprintf( |
300 | 300 | ' |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | { |
344 | 344 | if ($series > 0 && $episode > 0) { |
345 | 345 | $queryString = sprintf('tve.series = %d AND tve.episode = %d', $series, $episode); |
346 | - } elseif (! empty($airdate)) { |
|
346 | + } elseif (!empty($airdate)) { |
|
347 | 347 | $queryString = sprintf('DATE(tve.firstaired) = %s', escapeString(date('Y-m-d', strtotime($airdate)))); |
348 | 348 | } else { |
349 | 349 | return false; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | { |
383 | 383 | $showInfo['name'] = $this->parseName($relname); |
384 | 384 | |
385 | - if (! empty($showInfo['name'])) { |
|
385 | + if (!empty($showInfo['name'])) { |
|
386 | 386 | // Retrieve the country from the cleaned name |
387 | 387 | $showInfo['country'] = $this->parseCountry($showInfo['name']); |
388 | 388 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $showInfo += $this->parseSeasonEp($relname); |
394 | 394 | |
395 | 395 | if (isset($showInfo['season'], $showInfo['episode'])) { |
396 | - if (! isset($showInfo['airdate'])) { |
|
396 | + if (!isset($showInfo['airdate'])) { |
|
397 | 397 | // If year is present in the release name, add it to the cleaned name for title search |
398 | 398 | if (preg_match('/[^a-z0-9](?P<year>(19|20)(\d{2}))[^a-z0-9]/i', $relname, $yearMatch)) { |
399 | 399 | $showInfo['cleanname'] .= ' ('.$yearMatch['year'].')'; |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | */ |
609 | 609 | public function checkDate(bool|string|null $date): string |
610 | 610 | { |
611 | - if (! empty($date)) { |
|
611 | + if (!empty($date)) { |
|
612 | 612 | $chk = explode(' ', $date); |
613 | 613 | $chkd = explode('-', $chk[0]); |
614 | 614 | if ($chkd[1] > 12) { |
@@ -657,11 +657,11 @@ discard block |
||
657 | 657 | } |
658 | 658 | |
659 | 659 | foreach ($required as $req) { |
660 | - if (! \in_array($type, ['tmdbS', 'tmdbE', 'traktS', 'traktE'], false)) { |
|
661 | - if (! isset($array->$req)) { |
|
660 | + if (!\in_array($type, ['tmdbS', 'tmdbE', 'traktS', 'traktE'], false)) { |
|
661 | + if (!isset($array->$req)) { |
|
662 | 662 | return false; |
663 | 663 | } |
664 | - } elseif (! isset($array[$req])) { |
|
664 | + } elseif (!isset($array[$req])) { |
|
665 | 665 | return false; |
666 | 666 | } |
667 | 667 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | |
143 | 143 | if ((int) $videoId > 0 && (int) $tvDbId > 0) { |
144 | - if (! empty($tvdbShow['poster'])) { // Use TVDB poster if available |
|
144 | + if (!empty($tvdbShow['poster'])) { // Use TVDB poster if available |
|
145 | 145 | $this->getPoster($videoId); |
146 | 146 | } else { // Check Fanart.tv for poster |
147 | 147 | $poster = $this->fanart->getTVFanart($tvDbId); |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | - $seasonNo = (! empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : ''); |
|
155 | - $episodeNo = (! empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : ''); |
|
154 | + $seasonNo = (!empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : ''); |
|
155 | + $episodeNo = (!empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : ''); |
|
156 | 156 | |
157 | 157 | if ($episodeNo === 'all') { |
158 | 158 | // Set the video ID and leave episode 0 |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | // Download all episodes if new show to reduce API/bandwidth usage |
166 | - if (! $this->countEpsByVideoID($videoId)) { |
|
166 | + if (!$this->countEpsByVideoID($videoId)) { |
|
167 | 167 | $this->getEpisodeInfo($tvDbId, -1, -1, $videoId); |
168 | 168 | } |
169 | 169 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | // Check for show aliases and try match those too |
260 | - if (! empty($show->aliases)) { |
|
260 | + if (!empty($show->aliases)) { |
|
261 | 261 | foreach ($show->aliases as $key => $name) { |
262 | 262 | $matchPercent = $this->checkMatch(strtolower($name), strtolower($name), $matchPercent); |
263 | 263 | if ($matchPercent > $highestMatch) { |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | } |
270 | 270 | } |
271 | - if (! empty($highest)) { |
|
271 | + if (!empty($highest)) { |
|
272 | 272 | $return = $this->formatShowInfo($highest); |
273 | 273 | } |
274 | 274 | } |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $poster = $this->client->series()->artworks($show->tvdb_id); |
354 | 354 | // Grab the image with the highest score where type == 2 |
355 | 355 | $poster = collect($poster)->where('type', 2)->sortByDesc('score')->first(); |
356 | - $this->posterUrl = ! empty($poster->image) ? $poster->image : ''; |
|
356 | + $this->posterUrl = !empty($poster->image) ? $poster->image : ''; |
|
357 | 357 | } catch (ResourceNotFoundException $e) { |
358 | 358 | $this->colorCli->climate()->error('Poster image not found on TVDB'); |
359 | 359 | } |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | 'tvrage' => 0, |
380 | 380 | 'tvmaze' => 0, |
381 | 381 | 'tmdb' => 0, |
382 | - 'aliases' => ! empty($show->aliases) ? $show->aliases : '', |
|
382 | + 'aliases' => !empty($show->aliases) ? $show->aliases : '', |
|
383 | 383 | 'localzone' => "''", |
384 | 384 | ]; |
385 | 385 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $studio = false; |
103 | 103 | $director = false; |
104 | - if (($ret = $this->_html->find('div.page_video_info')) && ! empty($ret->find('text'))) { |
|
104 | + if (($ret = $this->_html->find('div.page_video_info')) && !empty($ret->find('text'))) { |
|
105 | 105 | foreach ($ret->find('text') as $e) { |
106 | 106 | $e = trim($e->plaintext); |
107 | 107 | $rArray = [',', '...', ' :']; |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | } |
116 | 116 | if ($studio === true) { |
117 | 117 | if ((stripos($e, 'Custodian of Records') === false) && stripos($e, 'Description') === false) { |
118 | - if ($director === true && ! empty($e)) { |
|
118 | + if ($director === true && !empty($e)) { |
|
119 | 119 | $this->_res['director'] = $e; |
120 | 120 | $e = null; |
121 | 121 | $director = false; |
122 | 122 | } |
123 | - if (! empty($e)) { |
|
123 | + if (!empty($e)) { |
|
124 | 124 | $this->_res['productinfo'][] = $e; |
125 | 125 | } |
126 | 126 | } else { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $title = trim($ret->title); |
209 | 209 | $title = str_replace('/XXX/', '', $title); |
210 | 210 | $title = preg_replace('/\(.*?\)|[._-]/', ' ', $title); |
211 | - if (! empty($title)) { |
|
211 | + if (!empty($title)) { |
|
212 | 212 | similar_text($movie, $title, $p); |
213 | 213 | if ($p >= 90) { |
214 | 214 | $this->_title = $title; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | protected function trailers(): mixed |
65 | 65 | { |
66 | 66 | $ret = $this->_html->find('a[itemprop=trailer]', 0); |
67 | - if (! empty($ret) && preg_match('/movieId=(?<movieid>\d+)&/', trim($ret->href), $hits)) { |
|
67 | + if (!empty($ret) && preg_match('/movieId=(?<movieid>\d+)&/', trim($ret->href), $hits)) { |
|
68 | 68 | $movieid = $hits['movieid']; |
69 | 69 | $this->_res['trailers']['url'] = self::AEBNSURL.self::TRAILERURL.$movieid; |
70 | 70 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $this->_res['genres'][] = trim($genre->plaintext); |
101 | 101 | } |
102 | 102 | } |
103 | - if (! empty($this->_res['genres'])) { |
|
103 | + if (!empty($this->_res['genres'])) { |
|
104 | 104 | $this->_res['genres'] = array_unique($this->_res['genres']); |
105 | 105 | } |
106 | 106 | |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | { |
115 | 115 | $this->_res = []; |
116 | 116 | $ret = $this->_html->findOne('div.starsFull'); |
117 | - if (! $ret instanceof SimpleHtmlDomNodeBlank) { |
|
117 | + if (!$ret instanceof SimpleHtmlDomNodeBlank) { |
|
118 | 118 | foreach ($ret->find('span[itemprop=name]') as $star) { |
119 | 119 | $this->_res['cast'][] = trim($star->plaintext); |
120 | 120 | } |
121 | 121 | } else { |
122 | 122 | $ret = $this->_html->findOne('div.detailsLink'); |
123 | - if (! $ret instanceof SimpleHtmlDomNodeBlank) { |
|
123 | + if (!$ret instanceof SimpleHtmlDomNodeBlank) { |
|
124 | 124 | foreach ($ret->find('span') as $star) { |
125 | 125 | if (strpos($star->plaintext, '/More/') !== false && strpos($star->plaintext, '/Stars/') !== false) { |
126 | 126 | $this->_res['cast'][] = trim($star->plaintext); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | if ($country === true) { |
136 | 136 | if (stripos($e, 'addthis_config') === false) { |
137 | - if (! empty($e)) { |
|
137 | + if (!empty($e)) { |
|
138 | 138 | $this->_res['productinfo'][] = $e; |
139 | 139 | } |
140 | 140 | } else { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $e = null; |
158 | 158 | } |
159 | 159 | if ($features === true) { |
160 | - if (! empty($e)) { |
|
160 | + if (!empty($e)) { |
|
161 | 161 | $this->_res['extras'][] = $e; |
162 | 162 | } |
163 | 163 | } |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | $e = null; |
189 | 189 | } |
190 | 190 | |
191 | - if (($director === true) && ! empty($e)) { |
|
191 | + if (($director === true) && !empty($e)) { |
|
192 | 192 | $this->_res['director'] = $e; |
193 | 193 | $director = false; |
194 | 194 | $e = null; |
195 | 195 | } |
196 | 196 | if (stripos($e, 'Country:') === false) { |
197 | - if (! empty($e)) { |
|
197 | + if (!empty($e)) { |
|
198 | 198 | $er[] = $e; |
199 | 199 | } |
200 | 200 | } else { |
@@ -231,12 +231,12 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function processSite(string $movie): bool |
233 | 233 | { |
234 | - if (! empty($movie)) { |
|
234 | + if (!empty($movie)) { |
|
235 | 235 | $this->_trailUrl = self::TRAILINGSEARCH.$movie; |
236 | 236 | $this->_response = getRawHtml(self::POPURL.$this->_trailUrl, $this->cookie); |
237 | 237 | if ($this->_response !== false) { |
238 | 238 | if ($ret = $this->_html->loadHtml($this->_response)->find('div.product-info, div.title', 1)) { |
239 | - if (! empty($ret->plaintext)) { |
|
239 | + if (!empty($ret->plaintext)) { |
|
240 | 240 | $this->_title = trim($ret->plaintext); |
241 | 241 | $title = str_replace('XXX', '', $ret->plaintext); |
242 | 242 | $title = trim(preg_replace('/\(.*?\)|[._-]/i', ' ', $title)); |