@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | if (empty($email) && empty($rssToken)) { |
| 47 | 47 | app('smarty.view')->assign('error', 'Missing parameter(email and/or apikey to send password reset'); |
| 48 | 48 | } else { |
| 49 | - if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) { |
|
| 49 | + if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) { |
|
| 50 | 50 | $this->validate($request, [ |
| 51 | 51 | 'g-recaptcha-response' => 'required|captcha', |
| 52 | 52 | ]); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | // |
| 55 | 55 | // Check users exists and send an email |
| 56 | 56 | // |
| 57 | - $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 57 | + $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 58 | 58 | if ($ret === null) { |
| 59 | 59 | app('smarty.view')->assign('error', 'The email or apikey are not recognised.'); |
| 60 | 60 | $sent = true; |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | if ($user !== null) { |
| 78 | 78 | $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on'; |
| 79 | 79 | |
| 80 | - if (! $user->isVerified() || $user->isPendingVerification()) { |
|
| 80 | + if (!$user->isVerified() || $user->isPendingVerification()) { |
|
| 81 | 81 | $request->session()->flash('message', 'You have not verified your email address!'); |
| 82 | 82 | |
| 83 | 83 | return $this->showLoginForm(); |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | |
| 77 | 77 | public function disable2fa(Disable2faPasswordSecurityRequest $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application |
| 78 | 78 | { |
| 79 | - if (! (Hash::check($request->get('current-password'), $request->user()->password))) { |
|
| 79 | + if (!(Hash::check($request->get('current-password'), $request->user()->password))) { |
|
| 80 | 80 | // The passwords matches |
| 81 | 81 | return redirect()->back()->with('error', 'Your password does not match with your account password. Please try again.'); |
| 82 | 82 | } |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | $meta_keywords = 'view,anime,anidb,description,details'; |
| 48 | 48 | $meta_description = 'View '.$aniDbInfo->title.' Anime'; |
| 49 | 49 | |
| 50 | - if (! $this->releases && ! $aniDbInfo) { |
|
| 50 | + if (!$this->releases && !$aniDbInfo) { |
|
| 51 | 51 | $this->smarty->assign('nodata', 'No releases and AniDB info for this series.'); |
| 52 | - } elseif (! $aniDbInfo) { |
|
| 52 | + } elseif (!$aniDbInfo) { |
|
| 53 | 53 | $this->smarty->assign('nodata', 'No AniDB information for this series.'); |
| 54 | - } elseif (! $aniDbReleases) { |
|
| 54 | + } elseif (!$aniDbReleases) { |
|
| 55 | 55 | $this->smarty->assign('nodata', 'No releases for this series.'); |
| 56 | 56 | } else { |
| 57 | 57 | $this->smarty->assign('animeEpisodeTitles', $aniDbReleases); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->setPreferences(); |
| 88 | 88 | $letter = ($request->has('id') && preg_match('/^(0\-9|[A-Z])$/i', $request->input('id'))) ? $request->input('id') : '0-9'; |
| 89 | 89 | |
| 90 | - $animeTitle = ($request->has('title') && ! empty($request->input('title'))) ? $request->input('title') : ''; |
|
| 90 | + $animeTitle = ($request->has('title') && !empty($request->input('title'))) ? $request->input('title') : ''; |
|
| 91 | 91 | |
| 92 | 92 | if ($animeTitle !== '' && $request->missing('id')) { |
| 93 | 93 | $letter = ''; |
@@ -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)); |