@@ -59,17 +59,17 @@ |
||
59 | 59 | { |
60 | 60 | $this->setPreferences(); |
61 | 61 | $ids = null; |
62 | - if (! empty($id) && ! \is_array($id)) { |
|
62 | + if (!empty($id) && !\is_array($id)) { |
|
63 | 63 | $ids = explode(',', $id); |
64 | 64 | } elseif (\is_array($id)) { |
65 | 65 | $ids = $id; |
66 | 66 | } |
67 | 67 | |
68 | - if (! empty($ids) && UsersRelease::delCartByGuid($ids, $this->userdata->id)) { |
|
68 | + if (!empty($ids) && UsersRelease::delCartByGuid($ids, $this->userdata->id)) { |
|
69 | 69 | return redirect()->to('/cart/index'); |
70 | 70 | } |
71 | 71 | |
72 | - if (! $id) { |
|
72 | + if (!$id) { |
|
73 | 73 | return redirect()->to('/cart/index'); |
74 | 74 | } |
75 | 75 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $privateProfiles = (int) Settings::settingValue('..privateprofiles') === 1; |
34 | 34 | $publicView = false; |
35 | 35 | |
36 | - if ($privileged || ! $privateProfiles) { |
|
36 | + if ($privileged || !$privateProfiles) { |
|
37 | 37 | $altID = ($request->has('id') && (int) $request->input('id') >= 0) ? (int) $request->input('id') : false; |
38 | 38 | $altUsername = ($request->has('name') && $request->input('name') !== '') ? $request->input('name') : false; |
39 | 39 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | // Check if the user selected a theme. |
66 | - if (! isset($this->userdata->style) || $this->userdata->style === 'None') { |
|
66 | + if (!isset($this->userdata->style) || $this->userdata->style === 'None') { |
|
67 | 67 | $this->userdata->style = 'Using the admin selected theme.'; |
68 | 68 | } |
69 | 69 | $this->smarty->assign( |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $action = $request->input('action') ?? 'view'; |
115 | 115 | |
116 | 116 | $userid = $this->userdata->id; |
117 | - if (! $this->userdata) { |
|
117 | + if (!$this->userdata) { |
|
118 | 118 | $this->show404('No such user!'); |
119 | 119 | } |
120 | 120 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | (int) Settings::settingValue('site.main.userselstyle') === 1 ? $request->input('style') : 'None' |
154 | 154 | ); |
155 | 155 | |
156 | - if ((int) $request->input('viewconsole') === 1 && $this->userdata->can('view console') && ! $this->userdata->hasDirectPermission('view console')) { |
|
156 | + if ((int) $request->input('viewconsole') === 1 && $this->userdata->can('view console') && !$this->userdata->hasDirectPermission('view console')) { |
|
157 | 157 | $this->userdata->givePermissionTo('view console'); |
158 | 158 | } elseif ((int) $request->input('viewconsole') === 0 && $this->userdata->can('view console') && $this->userdata->hasDirectPermission('view console')) { |
159 | 159 | $this->userdata->revokePermissionTo('view console'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $this->userdata->revokePermissionTo('view console'); |
162 | 162 | } |
163 | 163 | |
164 | - if ((int) $request->input('viewmovies') === 1 && $this->userdata->can('view movies') && ! $this->userdata->hasDirectPermission('view movies')) { |
|
164 | + if ((int) $request->input('viewmovies') === 1 && $this->userdata->can('view movies') && !$this->userdata->hasDirectPermission('view movies')) { |
|
165 | 165 | $this->userdata->givePermissionTo('view movies'); |
166 | 166 | } elseif ((int) $request->input('viewmovies') === 0 && $this->userdata->can('view movies') && $this->userdata->hasDirectPermission('view movies')) { |
167 | 167 | $this->userdata->revokePermissionTo('view movies'); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->userdata->revokePermissionTo('view movies'); |
170 | 170 | } |
171 | 171 | |
172 | - if ((int) $request->input('viewaudio') === 1 && $this->userdata->can('view audio') && ! $this->userdata->hasDirectPermission('view audio')) { |
|
172 | + if ((int) $request->input('viewaudio') === 1 && $this->userdata->can('view audio') && !$this->userdata->hasDirectPermission('view audio')) { |
|
173 | 173 | $this->userdata->givePermissionTo('view audio'); |
174 | 174 | } elseif ((int) $request->input('viewaudio') === 0 && $this->userdata->can('view audio') && $this->userdata->hasDirectPermission('view audio')) { |
175 | 175 | $this->userdata->revokePermissionTo('view audio'); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $this->userdata->revokePermissionTo('view audio'); |
178 | 178 | } |
179 | 179 | |
180 | - if ((int) $request->input('viewpc') === 1 && $this->userdata->can('view pc') && ! $this->userdata->hasDirectPermission('view pc')) { |
|
180 | + if ((int) $request->input('viewpc') === 1 && $this->userdata->can('view pc') && !$this->userdata->hasDirectPermission('view pc')) { |
|
181 | 181 | $this->userdata->givePermissionTo('view pc'); |
182 | 182 | } elseif ((int) $request->input('viewpc') === 0 && $this->userdata->can('view pc') && $this->userdata->hasDirectPermission('view pc')) { |
183 | 183 | $this->userdata->revokePermissionTo('view pc'); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $this->userdata->revokePermissionTo('view pc'); |
186 | 186 | } |
187 | 187 | |
188 | - if ((int) $request->input('viewtv') === 1 && $this->userdata->can('view tv') && ! $this->userdata->hasDirectPermission('view tv')) { |
|
188 | + if ((int) $request->input('viewtv') === 1 && $this->userdata->can('view tv') && !$this->userdata->hasDirectPermission('view tv')) { |
|
189 | 189 | $this->userdata->givePermissionTo('view tv'); |
190 | 190 | } elseif ((int) $request->input('viewtv') === 0 && $this->userdata->can('view tv') && $this->userdata->hasDirectPermission('view tv')) { |
191 | 191 | $this->userdata->revokePermissionTo('view tv'); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->userdata->revokePermissionTo('view tv'); |
194 | 194 | } |
195 | 195 | |
196 | - if ((int) $request->input('viewadult') === 1 && $this->userdata->can('view adult') && ! $this->userdata->hasDirectPermission('view adult')) { |
|
196 | + if ((int) $request->input('viewadult') === 1 && $this->userdata->can('view adult') && !$this->userdata->hasDirectPermission('view adult')) { |
|
197 | 197 | $this->userdata->givePermissionTo('view adult'); |
198 | 198 | } elseif ((int) $request->input('viewadult') === 0 && $this->userdata->can('view adult') && $this->userdata->hasDirectPermission('view adult')) { |
199 | 199 | $this->userdata->revokePermissionTo('view adult'); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $this->userdata->revokePermissionTo('view adult'); |
202 | 202 | } |
203 | 203 | |
204 | - if ((int) $request->input('viewbooks') === 1 && $this->userdata->can('view books') && ! $this->userdata->hasDirectPermission('view books')) { |
|
204 | + if ((int) $request->input('viewbooks') === 1 && $this->userdata->can('view books') && !$this->userdata->hasDirectPermission('view books')) { |
|
205 | 205 | $this->userdata->givePermissionTo('view books'); |
206 | 206 | } elseif ((int) $request->input('viewbooks') === 0 && $this->userdata->can('view books') && $this->userdata->hasDirectPermission('view books')) { |
207 | 207 | $this->userdata->revokePermissionTo('view books'); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $this->userdata->revokePermissionTo('view books'); |
210 | 210 | } |
211 | 211 | |
212 | - if ((int) $request->input('viewother') === 1 && $this->userdata->can('view other') && ! $this->userdata->hasDirectPermission('view other')) { |
|
212 | + if ((int) $request->input('viewother') === 1 && $this->userdata->can('view other') && !$this->userdata->hasDirectPermission('view other')) { |
|
213 | 213 | $this->userdata->givePermissionTo('view other'); |
214 | 214 | } elseif ((int) $request->input('viewother') === 0 && $this->userdata->can('view other') && $this->userdata->hasDirectPermission('view other')) { |
215 | 215 | $this->userdata->revokePermissionTo('view other'); |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | $this->userdata->revokePermissionTo('view other'); |
218 | 218 | } |
219 | 219 | |
220 | - if ($request->has('password') && ! empty($request->input('password'))) { |
|
220 | + if ($request->has('password') && !empty($request->input('password'))) { |
|
221 | 221 | User::updatePassword($userid, $request->input('password')); |
222 | 222 | } |
223 | 223 | |
224 | - if (! $this->userdata->hasRole('Admin')) { |
|
225 | - if (! empty($request->input('email')) && $this->userdata->email !== $request->input('email')) { |
|
224 | + if (!$this->userdata->hasRole('Admin')) { |
|
225 | + if (!empty($request->input('email')) && $this->userdata->email !== $request->input('email')) { |
|
226 | 226 | $this->userdata->email = $request->input('email'); |
227 | 227 | |
228 | 228 | $verify_user = $this->userdata; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $this->setPreferences(); |
276 | 276 | $userId = $request->input('id'); |
277 | 277 | |
278 | - if ($userId !== null && (int) $userId === $this->userdata->id && ! $this->userdata->hasRole('Admin')) { |
|
278 | + if ($userId !== null && (int) $userId === $this->userdata->id && !$this->userdata->hasRole('Admin')) { |
|
279 | 279 | $user = User::find($userId); |
280 | 280 | SendAccountDeletedEmail::dispatch($user); |
281 | 281 | Auth::logout(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | // Get the default user role. |
148 | 148 | $userDefault = Role::query()->where('isdefault', '=', 1)->first(); |
149 | 149 | |
150 | - if (! empty($error)) { |
|
150 | + if (!empty($error)) { |
|
151 | 151 | return $this->showRegistrationForm($request, $error); |
152 | 152 | } |
153 | 153 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | break; |
171 | 171 | case 'view': |
172 | 172 | // See if it is a valid invite. |
173 | - if (($inviteCode !== null) && ! Invite::isValid($inviteCode)) { |
|
173 | + if (($inviteCode !== null) && !Invite::isValid($inviteCode)) { |
|
174 | 174 | $error = 'Invalid invitation token!'; |
175 | 175 | $showRegister = 0; |
176 | 176 | } else { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | if ((int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) { |
205 | - if (! empty($inviteCode)) { |
|
205 | + if (!empty($inviteCode)) { |
|
206 | 206 | if (Invite::isValid($inviteCode)) { |
207 | 207 | $error = ''; |
208 | 208 | $showRegister = 1; |
@@ -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 |