From a0571293eed6c9132c2fa519f9590dd9b936e33c Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 14 May 2018 15:52:57 +0200 Subject: [PATCH] Fix couple of console problems --- Blacklight/Console.php | 6 +++--- Changelog | 1 + app/Http/Controllers/ConsoleController.php | 8 ++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Blacklight/Console.php b/Blacklight/Console.php index 97205f617..f398b2202 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -202,8 +202,8 @@ class Console $consoleIDs = $releaseIDs = false; if (\is_array($consoles['result'])) { foreach ($consoles['result'] as $console => $id) { - $consoleIDs[] = $id['id']; - $releaseIDs[] = $id['grp_release_id']; + $consoleIDs[] = $id->id; + $releaseIDs[] = $id->grp_release_id; } } $sql = sprintf( @@ -237,7 +237,7 @@ class Console return $return; } $return = DB::select($sql); - if (! empty($return)) { + if (\count($return) > 0) { $return['_totalcount'] = $consoles[0]->total ?? 0; } $expiresAt = Carbon::now()->addMinutes(config('nntmux.cache_expiry_long')); diff --git a/Changelog b/Changelog index bdc1d2a68..547aa61a9 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-05-14 DariusIII + * Fix: Fix couple of console problems * Fix: Use proper parameter to display release names in movies and XXX pages * Fix: Fix queries in Book and Console classes * Chg: Add check if the page variable is numeric to prevent errors in offset variable diff --git a/app/Http/Controllers/ConsoleController.php b/app/Http/Controllers/ConsoleController.php index c88566414..2b5c94142 100644 --- a/app/Http/Controllers/ConsoleController.php +++ b/app/Http/Controllers/ConsoleController.php @@ -18,6 +18,10 @@ class ConsoleController extends BasePageController public function show(Request $request, $id = '') { $this->setPrefs(); + if ($id === 'WiiVare') { + $id = 'WiiVareVC'; + } + $id = str_slug($id); $console = new Console(['Settings' => $this->settings]); $gen = new Genres(['Settings' => $this->settings]); @@ -27,7 +31,7 @@ class ConsoleController extends BasePageController $ctmp[] = [ 'id' => $ccat->id, - 'title' => $ccat->title, + 'title' => str_slug($ccat->title), ]; } $category = Category::GAME_ROOT; @@ -36,7 +40,7 @@ class ConsoleController extends BasePageController ->where('title', $id) ->where('parentid', '=', Category::GAME_ROOT) ->first(['id']); - $category = $cat !== null ? $cat['id'] : Category::MUSIC_ROOT; + $category = $cat !== null ? $cat['id'] : Category::GAME_ROOT; } $catarray = [];