@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $orderByUrls = []; |
| 62 | 62 | foreach ($releases->getBrowseOrdering() as $orderType) { |
| 63 | - $orderByUrls['orderby'.$orderType] = url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType); |
|
| 63 | + $orderByUrls['orderby'.$orderType] = url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES|ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $rslt = $releases->search( |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | if ($searchType !== 'basic' && $request->missing('id') && $request->missing('subject') && $request->anyFilled(['searchadvr', 'searchadvsubject', 'searchadvfilename', 'searchadvposter', 'minage', 'maxage', 'group', 'minsize', 'maxsize', 'search'])) { |
| 137 | 137 | $orderByString = ''; |
| 138 | 138 | foreach ($searchVars as $searchVarKey => $searchVar) { |
| 139 | - $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES | ENT_HTML5); |
|
| 139 | + $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES|ENT_HTML5); |
|
| 140 | 140 | } |
| 141 | 141 | $orderByString = ltrim($orderByString, '&'); |
| 142 | 142 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | // Get number of physical cores |
| 221 | 221 | preg_match_all('/^cpu cores\s*:\s*(\d+)/m', $cpuinfo, $coresMatches); |
| 222 | - if (! empty($coresMatches[1])) { |
|
| 222 | + if (!empty($coresMatches[1])) { |
|
| 223 | 223 | $info['cores'] = (int) $coresMatches[1][0]; |
| 224 | 224 | } |
| 225 | 225 | |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | // Get CPU model |
| 231 | 231 | preg_match('/^model name\s*:\s*(.+)$/m', $cpuinfo, $modelMatches); |
| 232 | - if (! empty($modelMatches[1])) { |
|
| 232 | + if (!empty($modelMatches[1])) { |
|
| 233 | 233 | $info['model'] = trim($modelMatches[1]); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // If cores is 0, try to get from physical id count |
| 237 | 237 | if ($info['cores'] === 0) { |
| 238 | 238 | preg_match_all('/^physical id\s*:\s*(\d+)/m', $cpuinfo, $physicalMatches); |
| 239 | - $uniquePhysical = ! empty($physicalMatches[1]) ? count(array_unique($physicalMatches[1])) : 1; |
|
| 239 | + $uniquePhysical = !empty($physicalMatches[1]) ? count(array_unique($physicalMatches[1])) : 1; |
|
| 240 | 240 | $info['cores'] = (int) ($info['threads'] / $uniquePhysical); |
| 241 | 241 | } |
| 242 | 242 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | // Add country data to each user based on their host IP |
| 57 | 57 | foreach ($results as $user) { |
| 58 | 58 | $position = null; |
| 59 | - if (! empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) { |
|
| 59 | + if (!empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) { |
|
| 60 | 60 | $position = Location::get($user->host); |
| 61 | 61 | } |
| 62 | 62 | $user->country_name = $position ? $position->countryName : null; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | // Handle rolechangedate - update if has value, clear if empty |
| 156 | 156 | if ($request->has('rolechangedate')) { |
| 157 | 157 | $roleChangeDate = $request->input('rolechangedate'); |
| 158 | - if (! empty($roleChangeDate)) { |
|
| 158 | + if (!empty($roleChangeDate)) { |
|
| 159 | 159 | User::updateUserRoleChangeDate($editedUser->id, $roleChangeDate); |
| 160 | 160 | } else { |
| 161 | 161 | // Clear the rolechangedate if empty string is provided |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | // convert from a string array to an int array, filtering out empty values |
| 63 | 63 | $books_selected = array_map(fn ($value) => (int) trim($value), array_filter($books_selected)); |
| 64 | 64 | |
| 65 | - $compress_headers_warning = ! str_contains(config('settings.nntp_server'), 'astra') ? 'compress_headers_warning' : ''; |
|
| 65 | + $compress_headers_warning = !str_contains(config('settings.nntp_server'), 'astra') ? 'compress_headers_warning' : ''; |
|
| 66 | 66 | |
| 67 | 67 | $this->viewData = array_merge($this->viewData, [ |
| 68 | 68 | 'error' => $error, |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | $seriessummary = ''; |
| 41 | 41 | $seriescountry = ''; |
| 42 | 42 | |
| 43 | - if (! $show) { |
|
| 43 | + if (!$show) { |
|
| 44 | 44 | $nodata = 'No video information for this series.'; |
| 45 | - } elseif (! $rel) { |
|
| 45 | + } elseif (!$rel) { |
|
| 46 | 46 | $nodata = 'No releases for this series.'; |
| 47 | 47 | } else { |
| 48 | 48 | $myshows = UserSerie::getShow($this->userdata->id, $show['id']); |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | $seriestitlesArray = $seriessummaryArray = $seriescountryArray = []; |
| 68 | 68 | $seriestitlesArray[] = $show['title']; |
| 69 | 69 | |
| 70 | - if (! empty($show['summary'])) { |
|
| 70 | + if (!empty($show['summary'])) { |
|
| 71 | 71 | $seriessummaryArray[] = $show['summary']; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! empty($show['countries_id'])) { |
|
| 74 | + if (!empty($show['countries_id'])) { |
|
| 75 | 75 | $seriescountryArray[] = $show['countries_id']; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $totalSeasonsAired = 0; |
| 92 | 92 | $totalEpisodesAired = 0; |
| 93 | 93 | |
| 94 | - if (! empty($show['id'])) { |
|
| 94 | + if (!empty($show['id'])) { |
|
| 95 | 95 | $episodeStats = \App\Models\TvEpisode::query() |
| 96 | 96 | ->where('videos_id', $show['id']) |
| 97 | 97 | ->whereNotNull('firstaired') |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | ->first(); |
| 101 | 101 | |
| 102 | 102 | if ($episodeStats) { |
| 103 | - if (! empty($episodeStats->first_aired) && $episodeStats->first_aired != '0000-00-00') { |
|
| 103 | + if (!empty($episodeStats->first_aired) && $episodeStats->first_aired != '0000-00-00') { |
|
| 104 | 104 | $firstEpisodeAired = \Carbon\Carbon::parse($episodeStats->first_aired); |
| 105 | 105 | } |
| 106 | - if (! empty($episodeStats->last_aired) && $episodeStats->last_aired != '0000-00-00') { |
|
| 106 | + if (!empty($episodeStats->last_aired) && $episodeStats->last_aired != '0000-00-00') { |
|
| 107 | 107 | $lastEpisodeAired = \Carbon\Carbon::parse($episodeStats->last_aired); |
| 108 | 108 | } |
| 109 | 109 | $totalSeasonsAired = $episodeStats->total_seasons ?? 0; |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | } else { |
| 143 | 143 | $letter = ($id && preg_match('/^(0\-9|[A-Z])$/i', $id)) ? $id : '0-9'; |
| 144 | 144 | |
| 145 | - $showname = ($request->has('title') && ! empty($request->input('title'))) ? $request->input('title') : ''; |
|
| 145 | + $showname = ($request->has('title') && !empty($request->input('title'))) ? $request->input('title') : ''; |
|
| 146 | 146 | |
| 147 | - if ($showname !== '' && ! $id) { |
|
| 147 | + if ($showname !== '' && !$id) { |
|
| 148 | 148 | $letter = ''; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $cacheKey = 'trending_tv_top_15_48h'; |
| 188 | 188 | |
| 189 | 189 | // Get trending TV shows from cache or calculate (refresh every hour) |
| 190 | - $trendingShows = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function () { |
|
| 190 | + $trendingShows = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function() { |
|
| 191 | 191 | // Calculate timestamp for 48 hours ago |
| 192 | 192 | $fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48); |
| 193 | 193 | |
@@ -60,12 +60,12 @@ |
||
| 60 | 60 | |
| 61 | 61 | // Then add the converted settings array as 'site' |
| 62 | 62 | // Using array assignment instead of constructor assignment to ensure it persists |
| 63 | - $this->viewData['site'] = $this->settings->map(function ($value) { |
|
| 63 | + $this->viewData['site'] = $this->settings->map(function($value) { |
|
| 64 | 64 | return Settings::convertValue($value); |
| 65 | 65 | })->all(); |
| 66 | 66 | |
| 67 | 67 | // Initialize userdata property for controllers that need it |
| 68 | - $this->middleware(function ($request, $next) { |
|
| 68 | + $this->middleware(function($request, $next) { |
|
| 69 | 69 | if (Auth::check()) { |
| 70 | 70 | $this->userdata = User::find(Auth::id()); |
| 71 | 71 | $this->userdata->categoryexclusions = User::getCategoryExclusionById(Auth::id()); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $movie = new Movie(['Settings' => $this->settings]); |
| 17 | 17 | |
| 18 | - $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) { |
|
| 18 | + $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function($mcat) { |
|
| 19 | 19 | return ['id' => $mcat->id, 'title' => $mcat->title]; |
| 20 | 20 | }); |
| 21 | 21 | |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $orderby = $request->input('ob', ''); |
| 34 | 34 | $ordering = $movie->getMovieOrdering(); |
| 35 | - if (! in_array($orderby, $ordering, false)) { |
|
| 35 | + if (!in_array($orderby, $ordering, false)) { |
|
| 36 | 36 | $orderby = ''; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $rslt = $movie->getMovieRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, -1, $this->userdata->categoryexclusions); |
| 40 | 40 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
| 41 | 41 | |
| 42 | - $movies = $results->map(function ($result) { |
|
| 42 | + $movies = $results->map(function($result) { |
|
| 43 | 43 | $result['genre'] = makeFieldLinks($result, 'genre', 'movies'); |
| 44 | 44 | $result['actors'] = makeFieldLinks($result, 'actors', 'movies'); |
| 45 | 45 | $result['director'] = makeFieldLinks($result, 'director', 'movies'); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | // Get movie info |
| 100 | 100 | $movieInfo = $movie->getMovieInfo($imdbid); |
| 101 | 101 | |
| 102 | - if (! $movieInfo) { |
|
| 102 | + if (!$movieInfo) { |
|
| 103 | 103 | return redirect()->route('Movies')->with('error', 'Movie not found'); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | // Filter to only this movie's IMDB ID |
| 110 | 110 | $movieData = collect($rslt)->firstWhere('imdbid', $imdbid); |
| 111 | 111 | |
| 112 | - if (! $movieData) { |
|
| 112 | + if (!$movieData) { |
|
| 113 | 113 | return redirect()->route('Movies')->with('error', 'No releases found for this movie'); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // Only process fields if they exist and are not empty |
| 137 | - if (! empty($movieArray['genre'])) { |
|
| 137 | + if (!empty($movieArray['genre'])) { |
|
| 138 | 138 | $movieArray['genre'] = makeFieldLinks($movieArray, 'genre', 'movies'); |
| 139 | 139 | } |
| 140 | - if (! empty($movieArray['actors'])) { |
|
| 140 | + if (!empty($movieArray['actors'])) { |
|
| 141 | 141 | $movieArray['actors'] = makeFieldLinks($movieArray, 'actors', 'movies'); |
| 142 | 142 | } |
| 143 | - if (! empty($movieArray['director'])) { |
|
| 143 | + if (!empty($movieArray['director'])) { |
|
| 144 | 144 | $movieArray['director'] = makeFieldLinks($movieArray, 'director', 'movies'); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | if ($request->has('id') && ctype_digit($request->input('id'))) { |
| 189 | 189 | $mov = $movie->getMovieInfo($request->input('id')); |
| 190 | 190 | |
| 191 | - if (! $mov) { |
|
| 191 | + if (!$mov) { |
|
| 192 | 192 | return response()->json(['message' => 'There is no trailer for this movie.'], 404); |
| 193 | 193 | } |
| 194 | 194 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $cacheKey = 'trending_movies_top_15_48h'; |
| 231 | 231 | |
| 232 | 232 | // Get trending movies from cache or calculate (refresh every hour) |
| 233 | - $trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function () { |
|
| 233 | + $trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function() { |
|
| 234 | 234 | // Calculate timestamp for 48 hours ago |
| 235 | 235 | $fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48); |
| 236 | 236 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | ->get(); |
| 263 | 263 | |
| 264 | 264 | // Process the results |
| 265 | - return $query->map(function ($item) { |
|
| 265 | + return $query->map(function($item) { |
|
| 266 | 266 | // Add cover image URL using helper function |
| 267 | 267 | $coverArray = [ |
| 268 | 268 | 'imdbid' => $item->imdbid, |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $user = $request->user(); |
| 88 | 88 | |
| 89 | 89 | // Only allow canceling if 2FA is not yet enabled |
| 90 | - if ($user->passwordSecurity()->exists() && ! $user->passwordSecurity->google2fa_enable) { |
|
| 90 | + if ($user->passwordSecurity()->exists() && !$user->passwordSecurity->google2fa_enable) { |
|
| 91 | 91 | $user->passwordSecurity()->delete(); |
| 92 | 92 | |
| 93 | 93 | return redirect()->to('profileedit#security')->with('success_2fa', '2FA setup has been cancelled.'); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | public function disable2fa(Disable2faPasswordSecurityRequest $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application |
| 100 | 100 | { |
| 101 | - if (! (Hash::check($request->get('current-password'), $request->user()->password))) { |
|
| 101 | + if (!(Hash::check($request->get('current-password'), $request->user()->password))) { |
|
| 102 | 102 | // Password doesn't match - always redirect to profile page with error |
| 103 | 103 | return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.'); |
| 104 | 104 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ]); |
| 127 | 127 | |
| 128 | 128 | // Get the user ID from session |
| 129 | - if (! $request->session()->has('2fa:user:id')) { |
|
| 129 | + if (!$request->session()->has('2fa:user:id')) { |
|
| 130 | 130 | return redirect()->route('login') |
| 131 | 131 | ->with('message', 'The two-factor authentication session has expired. Please login again.') |
| 132 | 132 | ->with('message_type', 'danger'); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $userId = $request->session()->get('2fa:user:id'); |
| 136 | 136 | $user = \App\Models\User::find($userId); |
| 137 | 137 | |
| 138 | - if (! $user || ! $user->passwordSecurity) { |
|
| 138 | + if (!$user || !$user->passwordSecurity) { |
|
| 139 | 139 | $request->session()->forget('2fa:user:id'); |
| 140 | 140 | |
| 141 | 141 | return redirect()->route('login') |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $request->input('one_time_password') |
| 150 | 150 | ); |
| 151 | 151 | |
| 152 | - if (! $valid) { |
|
| 152 | + if (!$valid) { |
|
| 153 | 153 | return redirect()->route('2fa.verify') |
| 154 | 154 | ->with('message', 'Invalid authentication code. Please try again.') |
| 155 | 155 | ->with('message_type', 'danger'); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | public function getVerify2fa(Request $request) |
| 227 | 227 | { |
| 228 | 228 | // Check if user ID is stored in the session |
| 229 | - if (! $request->session()->has('2fa:user:id')) { |
|
| 229 | + if (!$request->session()->has('2fa:user:id')) { |
|
| 230 | 230 | return redirect()->route('login') |
| 231 | 231 | ->withErrors(['msg' => 'The two-factor authentication session has expired. Please login again.']); |
| 232 | 232 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | // Get the user |
| 238 | 238 | $user = \App\Models\User::find($userId); |
| 239 | - if (! $user) { |
|
| 239 | + if (!$user) { |
|
| 240 | 240 | $request->session()->forget('2fa:user:id'); |
| 241 | 241 | |
| 242 | 242 | return redirect()->route('login') |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | 'current-password' => 'required', |
| 257 | 257 | ]); |
| 258 | 258 | |
| 259 | - if (! (Hash::check($request->get('current-password'), $request->user()->password))) { |
|
| 259 | + if (!(Hash::check($request->get('current-password'), $request->user()->password))) { |
|
| 260 | 260 | return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.'); |
| 261 | 261 | } |
| 262 | 262 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | |
| 25 | 25 | // If guid is passed as URL parameter, merge it into request as 'id' |
| 26 | - if ($guid !== null && ! $request->has('id')) { |
|
| 26 | + if ($guid !== null && !$request->has('id')) { |
|
| 27 | 27 | $request->merge(['id' => $guid]); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $res = User::getByRssToken($request->input('r')); |
| 45 | - if (! $res) { |
|
| 45 | + if (!$res) { |
|
| 46 | 46 | return Utility::showApiError(100); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return Utility::showApiError(501); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if (! $request->input('id')) { |
|
| 64 | + if (!$request->input('id')) { |
|
| 65 | 65 | return Utility::showApiError(200, 'Parameter id is required'); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $nzbPath = (new NZB)->getNZBPath($request->input('id')); |
| 99 | 99 | |
| 100 | - if (! File::exists($nzbPath)) { |
|
| 100 | + if (!File::exists($nzbPath)) { |
|
| 101 | 101 | return Utility::showApiError(300, 'NZB file not found!'); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | 'X-DNZB-Details' => url('/details/'.$request->input('id')), |
| 125 | 125 | ]; |
| 126 | 126 | |
| 127 | - if (! empty($relData['imdbid']) && $relData['imdbid'] > 0) { |
|
| 127 | + if (!empty($relData['imdbid']) && $relData['imdbid'] > 0) { |
|
| 128 | 128 | $headers['X-DNZB-MoreInfo'] = 'http://www.imdb.com/title/tt'.$relData['imdbid']; |
| 129 | - } elseif (! empty($relData['tvdb']) && $relData['tvdb'] > 0) { |
|
| 129 | + } elseif (!empty($relData['tvdb']) && $relData['tvdb'] > 0) { |
|
| 130 | 130 | $headers['X-DNZB-MoreInfo'] = 'http://www.thetvdb.com/?tab=series&id='.$relData['tvdb']; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $final = ''; |
| 157 | 157 | // Keep repeating until the end of the input file |
| 158 | - while (! gzeof($zd)) { |
|
| 158 | + while (!gzeof($zd)) { |
|
| 159 | 159 | // Read buffer-size bytes |
| 160 | 160 | $contents = gzread($zd, $buffer_size); |
| 161 | 161 | $tmp = preg_replace('/file poster=\"/i', 'file poster="'.$uid.'-', $contents, 10); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | // Sanitize file name |
| 170 | 170 | $cleanName = str_replace([',', ' ', '/', '\\'], '_', $relData['searchname']); |
| 171 | 171 | |
| 172 | - return response()->streamDownload(function () use ($final) { |
|
| 172 | + return response()->streamDownload(function() use ($final) { |
|
| 173 | 173 | echo $final; |
| 174 | 174 | }, $cleanName.'.nzb', $headers); |
| 175 | 175 | } |