@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $this->smarty->assign('category', -1); |
21 | 21 | |
22 | 22 | $ordering = $releases->getBrowseOrdering(); |
23 | - $orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : ''; |
|
23 | + $orderBy = $request->has('ob') && !empty($request->input('ob')) ? $request->input('ob') : ''; |
|
24 | 24 | $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; |
25 | 25 | $offset = ($page - 1) * config('nntmux.items_per_page'); |
26 | 26 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->smarty->assign('category', $category); |
84 | 84 | |
85 | 85 | $ordering = $releases->getBrowseOrdering(); |
86 | - $orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : ''; |
|
86 | + $orderBy = $request->has('ob') && !empty($request->input('ob')) ? $request->input('ob') : ''; |
|
87 | 87 | $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; |
88 | 88 | $offset = ($page - 1) * config('nntmux.items_per_page'); |
89 | 89 |
@@ -54,10 +54,10 @@ |
||
54 | 54 | $rslt = $music->getMusicRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, $this->userdata->categoryexclusions); |
55 | 55 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
56 | 56 | |
57 | - $artist = ($request->has('artist') && ! empty($request->input('artist'))) ? stripslashes($request->input('artist')) : ''; |
|
57 | + $artist = ($request->has('artist') && !empty($request->input('artist'))) ? stripslashes($request->input('artist')) : ''; |
|
58 | 58 | $this->smarty->assign('artist', $artist); |
59 | 59 | |
60 | - $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
60 | + $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
61 | 61 | $this->smarty->assign('title', $title); |
62 | 62 | |
63 | 63 | $genres = $gen->getGenres(Genres::MUSIC_TYPE, true); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $releases = new Releases(); |
118 | 118 | |
119 | 119 | // Set Query Parameters based on Request objects |
120 | - $outputXML = ! ($request->has('o') && $request->input('o') === 'json'); |
|
120 | + $outputXML = !($request->has('o') && $request->input('o') === 'json'); |
|
121 | 121 | $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0; |
122 | 122 | $offset = $this->offset($request); |
123 | 123 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | $this->addCoverURL( |
260 | 260 | $relData, |
261 | - function ($release) { |
|
261 | + function($release) { |
|
262 | 262 | return Utility::getCoverURL(['type' => 'movies', 'id' => $release->imdbid]); |
263 | 263 | } |
264 | 264 | ); |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | |
301 | 301 | if ($rel->isNotEmpty()) { |
302 | 302 | $data = ReleaseNfo::getReleaseNfo($rel->id); |
303 | - if (! empty($data)) { |
|
303 | + if (!empty($data)) { |
|
304 | 304 | if ($request->has('o') && $request->input('o') === 'file') { |
305 | - return response()->streamDownload(function () use ($data) { |
|
305 | + return response()->streamDownload(function() use ($data) { |
|
306 | 306 | echo $data['nfo']; |
307 | 307 | }, $rel['searchname'].'.nfo', ['Content-type:' => 'application/octet-stream']); |
308 | 308 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | header('Content-type: text/xml'); |
345 | 345 | } else { |
346 | 346 | // JSON encode the XMLWriter response |
347 | - $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES); |
|
347 | + $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR|JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES); |
|
348 | 348 | header('Content-type: application/json'); |
349 | 349 | } |
350 | 350 | if ($response === false) { |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | 'search' => ['available' => 'yes', 'supportedParams' => 'q'], |
388 | 388 | 'tv-search' => ['available' => 'yes', 'supportedParams' => 'q,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'], |
389 | 389 | 'movie-search' => ['available' => 'yes', 'supportedParams' => 'q,imdbid, tmdbid, traktid'], |
390 | - 'audio-search' => ['available' => 'no', 'supportedParams' => ''], |
|
390 | + 'audio-search' => ['available' => 'no', 'supportedParams' => ''], |
|
391 | 391 | ], |
392 | 392 | 'categories' => $this->type === 'caps' |
393 | 393 | ? Category::getForMenu() |
@@ -402,9 +402,9 @@ discard block |
||
402 | 402 | { |
403 | 403 | $maxAge = -1; |
404 | 404 | if ($request->has('maxage')) { |
405 | - if (! $request->filled('maxage')) { |
|
405 | + if (!$request->filled('maxage')) { |
|
406 | 406 | return Utility::showApiError(201, 'Incorrect parameter (maxage must not be empty)'); |
407 | - } elseif (! is_numeric($request->input('maxage'))) { |
|
407 | + } elseif (!is_numeric($request->input('maxage'))) { |
|
408 | 408 | return Utility::showApiError(201, 'Incorrect parameter (maxage must be numeric)'); |
409 | 409 | } else { |
410 | 410 | $maxAge = (int) $request->input('maxage'); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | if ($request->has('cat')) { |
424 | 424 | $categoryIDs = urldecode($request->input('cat')); |
425 | 425 | // Append Web-DL category ID if HD present for SickBeard / Sonarr compatibility. |
426 | - if (str_contains($categoryIDs, (string) Category::TV_HD) && ! str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('indexer.categorise.catwebdl') === 0) { |
|
426 | + if (str_contains($categoryIDs, (string) Category::TV_HD) && !str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('indexer.categorise.catwebdl') === 0) { |
|
427 | 427 | $categoryIDs .= (','.Category::TV_WEBDL); |
428 | 428 | } |
429 | 429 | $categoryID = explode(',', $categoryIDs); |
@@ -19,18 +19,18 @@ |
||
19 | 19 | */ |
20 | 20 | public function release(Request $request): \Illuminate\Http\JsonResponse |
21 | 21 | { |
22 | - $releaseObName = $request->has('relo') && ! empty($request->input('relo')) ? $request->input('relo') : ''; |
|
23 | - $releasePrName = $request->has('relp') && ! empty($request->input('relp')) ? $request->input('relp') : ''; |
|
24 | - $apiToken = $request->has('api_token') && ! empty($request->input('api_token')) ? $request->input('api_token') : ''; |
|
22 | + $releaseObName = $request->has('relo') && !empty($request->input('relo')) ? $request->input('relo') : ''; |
|
23 | + $releasePrName = $request->has('relp') && !empty($request->input('relp')) ? $request->input('relp') : ''; |
|
24 | + $apiToken = $request->has('api_token') && !empty($request->input('api_token')) ? $request->input('api_token') : ''; |
|
25 | 25 | $user = User::query()->where('api_token', $request->input('api_token'))->first(); |
26 | - if (! $user) { |
|
26 | + if (!$user) { |
|
27 | 27 | return response()->json(['message' => 'Indexer inform error, wrong api key!'], 404); |
28 | 28 | } |
29 | 29 | |
30 | - if (! empty($releaseObName) && ! empty($releasePrName) && ! empty($apiToken)) { |
|
30 | + if (!empty($releaseObName) && !empty($releasePrName) && !empty($apiToken)) { |
|
31 | 31 | ReleaseInform::insertOrIgnore(['relOName' => $releaseObName, 'relPName' => $releasePrName, 'api_token' => $apiToken, 'created_at' => now(), 'updated_at' => now()]); |
32 | 32 | $release = Release::whereSearchname($releaseObName)->first(); |
33 | - if (! empty($release)) { |
|
33 | + if (!empty($release)) { |
|
34 | 34 | (new NameFixer())->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true); |
35 | 35 | } |
36 | 36 |
@@ -245,14 +245,14 @@ discard block |
||
245 | 245 | $this->xml->startElement('category'); |
246 | 246 | $this->xml->writeAttribute('id', $this->parameters['id']); |
247 | 247 | $this->xml->writeAttribute('name', html_entity_decode($this->parameters['title'])); |
248 | - if (! empty($this->parameters['description'])) { |
|
248 | + if (!empty($this->parameters['description'])) { |
|
249 | 249 | $this->xml->writeAttribute('description', html_entity_decode($this->parameters['description'])); |
250 | 250 | } |
251 | 251 | foreach ($this->parameters['categories'] as $c) { |
252 | 252 | $this->xml->startElement('subcat'); |
253 | 253 | $this->xml->writeAttribute('id', $c['id']); |
254 | 254 | $this->xml->writeAttribute('name', html_entity_decode($c['title'])); |
255 | - if (! empty($c['description'])) { |
|
255 | + if (!empty($c['description'])) { |
|
256 | 256 | $this->xml->writeAttribute('description', html_entity_decode($c['description'])); |
257 | 257 | } |
258 | 258 | $this->xml->endElement(); |
@@ -353,10 +353,10 @@ discard block |
||
353 | 353 | $this->xml->writeAttribute('apimax', $this->parameters['apilimit']); |
354 | 354 | $this->xml->writeAttribute('grabcurrent', $this->parameters['grabs']); |
355 | 355 | $this->xml->writeAttribute('grabmax', $this->parameters['downloadlimit']); |
356 | - if (! empty($this->parameters['oldestapi'])) { |
|
356 | + if (!empty($this->parameters['oldestapi'])) { |
|
357 | 357 | $this->xml->writeAttribute('apioldesttime', $this->parameters['oldestapi']); |
358 | 358 | } |
359 | - if (! empty($this->parameters['oldestgrab'])) { |
|
359 | + if (!empty($this->parameters['oldestgrab'])) { |
|
360 | 360 | $this->xml->writeAttribute('graboldesttime', $this->parameters['oldestgrab']); |
361 | 361 | } |
362 | 362 | $this->xml->endElement(); |
@@ -367,8 +367,8 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function includeReleases(): void |
369 | 369 | { |
370 | - if (! empty($this->releases)) { |
|
371 | - if (! $this->releases instanceof Release) { |
|
370 | + if (!empty($this->releases)) { |
|
371 | + if (!$this->releases instanceof Release) { |
|
372 | 372 | foreach ($this->releases as $this->release) { |
373 | 373 | $this->xml->startElement('item'); |
374 | 374 | $this->includeReleaseMain(); |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | } else { |
410 | 410 | $this->writeRssCdata(); |
411 | 411 | } |
412 | - if (! isset($this->parameters['dl']) || (isset($this->parameters['dl']) && (int) $this->parameters['dl'] === 1)) { |
|
412 | + if (!isset($this->parameters['dl']) || (isset($this->parameters['dl']) && (int) $this->parameters['dl'] === 1)) { |
|
413 | 413 | $this->xml->startElement('enclosure'); |
414 | 414 | $this->xml->writeAttribute( |
415 | 415 | 'url', |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | { |
431 | 431 | $this->writeZedAttr('category', $this->release->categories_id); |
432 | 432 | $this->writeZedAttr('size', $this->release->size); |
433 | - if (! empty($this->release->coverurl)) { |
|
433 | + if (!empty($this->release->coverurl)) { |
|
434 | 434 | $this->writeZedAttr( |
435 | 435 | 'coverurl', |
436 | 436 | $this->server['server']['url']."/covers/{$this->release->coverurl}" |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $this->writeZedAttr('comments', $this->release->comments); |
466 | 466 | $this->writeZedAttr('password', $this->release->passwordstatus); |
467 | 467 | $this->writeZedAttr('usenetdate', Carbon::parse($this->release->postdate)->toRssString()); |
468 | - if (! empty($this->release->group_name)) { |
|
468 | + if (!empty($this->release->group_name)) { |
|
469 | 469 | $this->writeZedAttr('group', $this->release->group_name); |
470 | 470 | } |
471 | 471 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | */ |
477 | 477 | protected function setTvAttr(): void |
478 | 478 | { |
479 | - if (! empty($this->release->title)) { |
|
479 | + if (!empty($this->release->title)) { |
|
480 | 480 | $this->writeZedAttr('title', $this->release->title); |
481 | 481 | } |
482 | 482 | if (isset($this->release->series) && $this->release->series > 0) { |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | if (isset($this->release->episode->episode) && $this->release->episode->episode > 0) { |
486 | 486 | $this->writeZedAttr('episode', $this->release->episode->episode); |
487 | 487 | } |
488 | - if (! empty($this->release->firstaired)) { |
|
488 | + if (!empty($this->release->firstaired)) { |
|
489 | 489 | $this->writeZedAttr('tvairdate', $this->release->firstaired); |
490 | 490 | } |
491 | 491 | if (isset($this->release->tvdb) && $this->release->tvdb > 0) { |
@@ -531,19 +531,19 @@ discard block |
||
531 | 531 | { |
532 | 532 | $this->cdata = "\n\t<div>\n"; |
533 | 533 | switch (1) { |
534 | - case ! empty($this->release->cover): |
|
534 | + case !empty($this->release->cover): |
|
535 | 535 | $dir = 'movies'; |
536 | 536 | $column = 'imdbid'; |
537 | 537 | break; |
538 | - case ! empty($this->release->mu_cover): |
|
538 | + case !empty($this->release->mu_cover): |
|
539 | 539 | $dir = 'music'; |
540 | 540 | $column = 'musicinfo_id'; |
541 | 541 | break; |
542 | - case ! empty($this->release->co_cover): |
|
542 | + case !empty($this->release->co_cover): |
|
543 | 543 | $dir = 'console'; |
544 | 544 | $column = 'consoleinfo_id'; |
545 | 545 | break; |
546 | - case ! empty($this->release->bo_cover): |
|
546 | + case !empty($this->release->bo_cover): |
|
547 | 547 | $dir = 'books'; |
548 | 548 | $column = 'bookinfo_id'; |
549 | 549 | break; |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | $cData = ''; |
680 | 680 | |
681 | 681 | foreach ($columns as $info) { |
682 | - if (! empty($this->release->$info)) { |
|
682 | + if (!empty($this->release->$info)) { |
|
683 | 683 | if ($info === 'mu_releasedate') { |
684 | 684 | $ucInfo = 'Released'; |
685 | 685 | $rDate = date('Y-m-d', strtotime($this->release->$info)); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | Category::TV_ROOT, |
138 | 138 | Category::TV_OTHER, |
139 | 139 | $this->releases->showPasswords(), |
140 | - ! empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : '' |
|
140 | + !empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : '' |
|
141 | 141 | ); |
142 | 142 | |
143 | 143 | $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium')); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | Category::MOVIE_ROOT, |
190 | 190 | Category::MOVIE_OTHER, |
191 | 191 | $this->releases->showPasswords(), |
192 | - ! empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : '' |
|
192 | + !empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : '' |
|
193 | 193 | ); |
194 | 194 | |
195 | 195 | $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium')); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $meta_title = $title = 'Category Regex List'; |
21 | 21 | |
22 | - $group = $request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''; |
|
22 | + $group = $request->has('group') && !empty($request->input('group')) ? $request->input('group') : ''; |
|
23 | 23 | $regex = $regexes->getRegex($group); |
24 | 24 | |
25 | 25 | $this->smarty->assign( |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | break; |
73 | 73 | } |
74 | 74 | |
75 | - if (! is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { |
|
75 | + if (!is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { |
|
76 | 76 | $this->smarty->assign('error', 'Ordinal must be a number, 0 or higher.'); |
77 | 77 | break; |
78 | 78 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $meta_title = $title = 'Collections Regex List'; |
21 | 21 | |
22 | - $group = ($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''); |
|
22 | + $group = ($request->has('group') && !empty($request->input('group')) ? $request->input('group') : ''); |
|
23 | 23 | $regex = $regexes->getRegex($group); |
24 | 24 | $this->smarty->assign(compact('group', 'regex')); |
25 | 25 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $request->merge(['description' => '']); |
59 | 59 | } |
60 | 60 | |
61 | - if (! is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { |
|
61 | + if (!is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { |
|
62 | 62 | $error = 'Ordinal must be a number, 0 or higher.'; |
63 | 63 | break; |
64 | 64 | } |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | $this->setAdminPrefs(); |
105 | 105 | $meta_title = $title = 'Collections Regex Test'; |
106 | 106 | |
107 | - $group = trim($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''); |
|
108 | - $regex = trim($request->has('regex') && ! empty($request->input('regex')) ? $request->input('regex') : ''); |
|
107 | + $group = trim($request->has('group') && !empty($request->input('group')) ? $request->input('group') : ''); |
|
108 | + $regex = trim($request->has('regex') && !empty($request->input('regex')) ? $request->input('regex') : ''); |
|
109 | 109 | $limit = ($request->has('limit') && is_numeric($request->input('limit')) ? $request->input('limit') : 50); |
110 | 110 | $this->smarty->assign(['group' => $group, 'regex' => $regex, 'limit' => $limit]); |
111 | 111 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $id = $request->input('id'); |
51 | 51 | $game = $games->getGamesInfoById($id); |
52 | 52 | |
53 | - if (! $game) { |
|
53 | + if (!$game) { |
|
54 | 54 | $this->show404(); |
55 | 55 | } |
56 | 56 | |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | if ($_FILES['cover']['size'] > 0) { |
62 | 62 | $tmpName = $_FILES['cover']['tmp_name']; |
63 | 63 | $file_info = getimagesize($tmpName); |
64 | - if (! empty($file_info)) { |
|
64 | + if (!empty($file_info)) { |
|
65 | 65 | move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc); |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | $request->merge(['cover' => file_exists($coverLoc) ? 1 : 0]); |
70 | - $request->merge(['releasedate' => (empty($request->input('releasedate')) || ! strtotime($request->input('releasedate'))) ? $game['releasedate'] : Carbon::parse($request->input('releasedate'))->timestamp]); |
|
70 | + $request->merge(['releasedate' => (empty($request->input('releasedate')) || !strtotime($request->input('releasedate'))) ? $game['releasedate'] : Carbon::parse($request->input('releasedate'))->timestamp]); |
|
71 | 71 | |
72 | 72 | $games->update($id, $request->input('title'), $request->input('asin'), $request->input('url'), $request->input('publisher'), $request->input('releasedate'), $request->input('esrb'), $request->input('cover'), $request->input('trailerurl'), $request->input('genre')); |
73 | 73 |