@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | switch ($action) { |
32 | 32 | case 'delete': |
33 | 33 | $show = UserSerie::getShow($this->userdata->id, $videoId); |
34 | - if (! $show) { |
|
34 | + if (!$show) { |
|
35 | 35 | return redirect()->back(); |
36 | 36 | } |
37 | 37 | |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | $show = Video::getByVideoID($videoId); |
54 | - if (! $show) { |
|
54 | + if (!$show) { |
|
55 | 55 | return redirect()->to('myshows'); |
56 | 56 | } |
57 | 57 | |
58 | 58 | if ($action === 'doadd') { |
59 | - $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : []; |
|
59 | + $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : []; |
|
60 | 60 | UserSerie::addShow($this->userdata->id, $videoId, $category); |
61 | 61 | if ($request->has('from')) { |
62 | 62 | return redirect()->to($request->input('from')); |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | case 'doedit': |
91 | 91 | $show = UserSerie::getShow($this->userdata->id, $videoId); |
92 | 92 | |
93 | - if (! $show) { |
|
93 | + if (!$show) { |
|
94 | 94 | return redirect()->to('myshows'); |
95 | 95 | } |
96 | 96 | |
97 | 97 | if ($action === 'doedit') { |
98 | - $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : []; |
|
98 | + $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : []; |
|
99 | 99 | UserSerie::updateShow($this->userdata->id, $videoId, $category); |
100 | 100 | if ($request->has('from')) { |
101 | 101 | return redirect()->to($request->input('from')); |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | $results = []; |
140 | 140 | foreach ($shows as $showk => $show) { |
141 | 141 | $showcats = explode('|', $show['categories']); |
142 | - if (\is_array($showcats) && ! empty($showcats)) { |
|
142 | + if (\is_array($showcats) && !empty($showcats)) { |
|
143 | 143 | $catarr = []; |
144 | 144 | foreach ($showcats as $scat) { |
145 | - if (! empty($scat)) { |
|
145 | + if (!empty($scat)) { |
|
146 | 146 | $catarr[] = $categories[$scat]; |
147 | 147 | } |
148 | 148 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function deleteTitle(int $anidbID): void |
57 | 57 | { |
58 | - DB::transaction(function () use ($anidbID) { |
|
58 | + DB::transaction(function() use ($anidbID) { |
|
59 | 59 | DB::delete( |
60 | 60 | sprintf( |
61 | 61 | ' |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | private function getListQuery(string $type = '', bool $activeOnly = false): string |
59 | 59 | { |
60 | - if (! empty($type)) { |
|
60 | + if (!empty($type)) { |
|
61 | 61 | $typesql = sprintf(' AND g.type = %d', $type); |
62 | 62 | } else { |
63 | 63 | $typesql = ''; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | public function getCount(string $type = '', bool $activeOnly = false): mixed |
105 | 105 | { |
106 | - if (! empty($type)) { |
|
106 | + if (!empty($type)) { |
|
107 | 107 | $typesql = sprintf(' AND g.type = %d', $type); |
108 | 108 | } else { |
109 | 109 | $typesql = ''; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $foundNFO = true; |
140 | 140 | } |
141 | 141 | |
142 | - if ($foundNFO === false && $hiddenNFO === false && preg_match('/\(1\/1\)$/i', $subject) && ! preg_match('/\.(apk|bat|bmp|cbr|cbz|cfg|css|csv|cue|db|dll|doc|epub|exe|gif|htm|ico|idx|ini'.'|jpg|lit|log|m3u|mid|mobi|mp3|nib|nzb|odt|opf|otf|par|par2|pdf|psd|pps|png|ppt|r\d{2,4}'.'|rar|sfv|srr|sub|srt|sql|rom|rtf|tif|torrent|ttf|txt|vb|vol\d+\+\d+|wps|xml|zip)/i', $subject)) { |
|
142 | + if ($foundNFO === false && $hiddenNFO === false && preg_match('/\(1\/1\)$/i', $subject) && !preg_match('/\.(apk|bat|bmp|cbr|cbz|cfg|css|csv|cue|db|dll|doc|epub|exe|gif|htm|ico|idx|ini'.'|jpg|lit|log|m3u|mid|mobi|mp3|nib|nzb|odt|opf|otf|par|par2|pdf|psd|pps|png|ppt|r\d{2,4}'.'|rar|sfv|srr|sub|srt|sql|rom|rtf|tif|torrent|ttf|txt|vb|vol\d+\+\d+|wps|xml|zip)/i', $subject)) { |
|
143 | 143 | $hiddenID = (string) $nzbcontents->segments->segment; |
144 | 144 | $hiddenNFO = true; |
145 | 145 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | return false; |
185 | 185 | } |
186 | 186 | $nzbContents = Utility::unzipGzipFile($nzbPath); |
187 | - if (! $nzbContents) { |
|
187 | + if (!$nzbContents) { |
|
188 | 188 | if ($this->echooutput) { |
189 | 189 | echo PHP_EOL. |
190 | 190 | 'Unable to decompress: '. |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | } |
200 | 200 | |
201 | 201 | $nzbFile = @simplexml_load_string($nzbContents); |
202 | - if (! $nzbFile) { |
|
202 | + if (!$nzbFile) { |
|
203 | 203 | if ($this->echooutput) { |
204 | 204 | echo PHP_EOL."Unable to load NZB: $guid appears to be an invalid NZB, skipping.".PHP_EOL; |
205 | 205 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $url = self::API_URL."shows/{$id}/seasons/{$season}/episodes/{$ep}"; |
58 | 58 | |
59 | 59 | $array = $this->getJsonArray($url, $extended); |
60 | - if (! \is_array($array)) { |
|
60 | + if (!\is_array($array)) { |
|
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $array = $this->getJsonArray( |
73 | 73 | self::API_URL.'movies/boxoffice' |
74 | 74 | ); |
75 | - if (! $array) { |
|
75 | + if (!$array) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $array = $this->getJsonArray( |
88 | 88 | self::API_URL.'calendars/all/shows/'.$start.'/'.$days |
89 | 89 | ); |
90 | - if (! $array) { |
|
90 | + if (!$array) { |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $extendedString = '?extended='.$extended; |
108 | 108 | } |
109 | 109 | |
110 | - if (! empty($this->requestHeaders)) { |
|
110 | + if (!empty($this->requestHeaders)) { |
|
111 | 111 | try { |
112 | 112 | $json = $this->client->get( |
113 | 113 | $URI.$extendedString, |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | return false; |
122 | 122 | } |
123 | 123 | |
124 | - if (! empty($json)) { |
|
124 | + if (!empty($json)) { |
|
125 | 125 | $json = json_decode($json, true); |
126 | - if (! \is_array($json) || (isset($json['status']) && $json['status'] === 'failure')) { |
|
126 | + if (!\is_array($json) || (isset($json['status']) && $json['status'] === 'failure')) { |
|
127 | 127 | return false; |
128 | 128 | } |
129 | 129 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | default => 'min', |
147 | 147 | }; |
148 | 148 | $array = $this->getJsonArray(self::API_URL.'movies/'.Str::slug($movie), $extended); |
149 | - if (! $array) { |
|
149 | + if (!$array) { |
|
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | if ($type === 'imdbid' && isset($array['ids']['imdb'])) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function searchId(int|string $id, string $site = 'trakt', int|string $type = 0) |
165 | 165 | { |
166 | - if (! \in_array($site, self::$types, false) || ! ctype_digit($id)) { |
|
166 | + if (!\in_array($site, self::$types, false) || !ctype_digit($id)) { |
|
167 | 167 | return; |
168 | 168 | } |
169 | 169 | if ($site === 'imdb') { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | foreach ($directories as $directory) { |
63 | 63 | $pool = Pool::create()->concurrency($maxProcesses)->timeout(3600); |
64 | - $pool->add(function () use ($directory) { |
|
64 | + $pool->add(function() use ($directory) { |
|
65 | 65 | $this->_executeCommand( |
66 | 66 | $this->importPath.'"'. |
67 | 67 | $directory.'" '. |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | $this->useFileName.' '. |
71 | 71 | $this->maxPerProcess |
72 | 72 | ); |
73 | - })->then(function () { |
|
73 | + })->then(function() { |
|
74 | 74 | $this->colorCli->header('Finished importing new nzbs', true); |
75 | - })->catch(function (\Throwable $exception) { |
|
75 | + })->catch(function(\Throwable $exception) { |
|
76 | 76 | // Handle exception |
77 | 77 | }); |
78 | 78 | $pool->wait(); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $episodeArray[$i]['episode_no'] = (int) $episode->epno; |
133 | 133 | $episodeArray[$i]['airdate'] = (string) $episode->airdate; |
134 | 134 | |
135 | - if (! empty($episode->title)) { |
|
135 | + if (!empty($episode->title)) { |
|
136 | 136 | foreach ($episode->title as $title) { |
137 | 137 | $xmlAttribs = $title->attributes('xml', true); |
138 | 138 | // only english, x-jat imploded episode titles for now |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | 'updated' => now(), |
253 | 253 | ] |
254 | 254 | ); |
255 | - if (! empty($AniDBInfoArray['epsarr'])) { |
|
255 | + if (!empty($AniDBInfoArray['epsarr'])) { |
|
256 | 256 | $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']); |
257 | 257 | } |
258 | 258 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | private function insertAniDBEpisodes($aniDbId, array $episodeArr = []): void |
263 | 263 | { |
264 | - if (! empty($episodeArr)) { |
|
264 | + if (!empty($episodeArr)) { |
|
265 | 265 | foreach ($episodeArr as $episode) { |
266 | 266 | AnidbEpisode::insertOrIgnore( |
267 | 267 | [ |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | 'updated' => now(), |
421 | 421 | ] |
422 | 422 | ); |
423 | - if (! empty($AniDBInfoArray['epsarr'])) { |
|
423 | + if (!empty($AniDBInfoArray['epsarr'])) { |
|
424 | 424 | $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']); |
425 | 425 | } |
426 | 426 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | $picture = $this->updateAniDBInfoEps($aniDbId, $AniDBInfoArray); |
438 | 438 | } |
439 | 439 | |
440 | - if (! empty($picture) && ! file_exists($this->imgSavePath.$aniDbId.'.jpg')) { |
|
440 | + if (!empty($picture) && !file_exists($this->imgSavePath.$aniDbId.'.jpg')) { |
|
441 | 441 | (new ReleaseImage())->saveImage( |
442 | 442 | $aniDbId, |
443 | 443 | 'http://img7.anidb.net/pics/anime/'.$picture, |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->colorCli->header($dMessage); |
87 | 87 | } |
88 | 88 | |
89 | - if ($articles !== '' && ! is_numeric($articles)) { |
|
89 | + if ($articles !== '' && !is_numeric($articles)) { |
|
90 | 90 | $articles = 20000; |
91 | 91 | } |
92 | 92 | |
@@ -181,8 +181,7 @@ discard block |
||
181 | 181 | $dMessage = |
182 | 182 | 'We have hit the maximum we can backfill for '. |
183 | 183 | $groupName. |
184 | - ($this->_disableBackfillGroup ? ', disabling backfill on it.' : |
|
185 | - ', skipping it, consider disabling backfill on it.'); |
|
184 | + ($this->_disableBackfillGroup ? ', disabling backfill on it.' : ', skipping it, consider disabling backfill on it.'); |
|
186 | 185 | |
187 | 186 | if ($this->_disableBackfillGroup) { |
188 | 187 | UsenetGroup::updateGroupStatus($groupArr['id'], 'backfill', 0); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $buffer .= sprintf($this->tmpMasks[3], 'File System', 'Used', 'Free'); |
406 | 406 | $buffer .= $this->_getSeparator(); |
407 | 407 | |
408 | - if (! empty($monitor_path) && file_exists($monitor_path)) { |
|
408 | + if (!empty($monitor_path) && file_exists($monitor_path)) { |
|
409 | 409 | $disk_use = $this->decodeSize(disk_total_space($monitor_path) - disk_free_space($monitor_path)); |
410 | 410 | $disk_free = $this->decodeSize(disk_free_space($monitor_path)); |
411 | 411 | if (basename($monitor_path) === '') { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $buffer .= sprintf($this->tmpMasks[4], $show, $disk_use, $disk_free); |
417 | 417 | } |
418 | 418 | |
419 | - if (! empty($monitor_path_a) && file_exists($monitor_path_a)) { |
|
419 | + if (!empty($monitor_path_a) && file_exists($monitor_path_a)) { |
|
420 | 420 | $disk_use = $this->decodeSize(disk_total_space($monitor_path_a) - disk_free_space($monitor_path_a)); |
421 | 421 | $disk_free = $this->decodeSize(disk_free_space($monitor_path_a)); |
422 | 422 | if (basename($monitor_path_a) === '') { |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $buffer .= sprintf($this->tmpMasks[4], $show, $disk_use, $disk_free); |
428 | 428 | } |
429 | 429 | |
430 | - if (! empty($monitor_path_b) && file_exists($monitor_path_b)) { |
|
430 | + if (!empty($monitor_path_b) && file_exists($monitor_path_b)) { |
|
431 | 431 | $disk_use = $this->decodeSize(disk_total_space($monitor_path_b) - disk_free_space($monitor_path_b)); |
432 | 432 | $disk_free = $this->decodeSize(disk_free_space($monitor_path_b)); |
433 | 433 | if (basename($monitor_path_b) === '') { |