mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix numerous category browsing issues
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-04-20 DariusIII
|
||||
* Fix: Fix numerous category browsing issues
|
||||
* Chg: Update browsing per category
|
||||
* Chg: Update anime page links in all the themes
|
||||
* Chg: Fix myshows/browse page
|
||||
|
||||
@@ -13,7 +13,7 @@ class BooksController extends BasePageController
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request, $id = '')
|
||||
{
|
||||
$this->setPrefs();
|
||||
$book = new Books(['Settings' => $this->settings]);
|
||||
@@ -22,15 +22,27 @@ class BooksController extends BasePageController
|
||||
|
||||
$btmp = [];
|
||||
foreach ($boocats as $bcat) {
|
||||
$btmp[$bcat['id']] = $bcat;
|
||||
$btmp[] =
|
||||
[
|
||||
'id' => $bcat->id,
|
||||
'title' => $bcat->title,
|
||||
];
|
||||
}
|
||||
$category = Category::BOOKS_ROOT;
|
||||
if ($id && \in_array($id, array_pluck($btmp, 'title'), false)) {
|
||||
$cat = Category::query()
|
||||
->where('title', $id)
|
||||
->where('parentid', '=', Category::BOOKS_ROOT)
|
||||
->first(['id']);
|
||||
$category = $cat !== null ? $cat['id'] : Category::BOOKS_ROOT;
|
||||
}
|
||||
|
||||
$catarray = [];
|
||||
$catarray[] = $category;
|
||||
|
||||
$this->smarty->assign('catlist', $btmp);
|
||||
$this->smarty->assign('category', $category);
|
||||
$this->smarty->assign('categorytitle', $id);
|
||||
|
||||
$ordering = $book->getBookOrdering();
|
||||
$orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : '';
|
||||
@@ -64,7 +76,7 @@ class BooksController extends BasePageController
|
||||
} else {
|
||||
$cdata = Category::find($category);
|
||||
if ($cdata !== null) {
|
||||
$this->smarty->assign('catname', $cdata->parent !== null ? $cdata->parent->title.' > '.$cdata->title : $cdata->title);
|
||||
$this->smarty->assign('catname', $cdata->parentid !== null ? $cdata->parent->title.' > '.$cdata->title : $cdata->title);
|
||||
} else {
|
||||
$this->show404();
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ class ConsoleController extends BasePageController
|
||||
{
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $id
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request)
|
||||
public function show(Request $request, $id = '')
|
||||
{
|
||||
$this->setPrefs();
|
||||
$console = new Console(['Settings' => $this->settings]);
|
||||
@@ -22,15 +24,27 @@ class ConsoleController extends BasePageController
|
||||
$concats = Category::getChildren(Category::GAME_ROOT);
|
||||
$ctmp = [];
|
||||
foreach ($concats as $ccat) {
|
||||
$ctmp[$ccat['id']] = $ccat;
|
||||
$ctmp[] =
|
||||
[
|
||||
'id' => $ccat->id,
|
||||
'title' => $ccat->title,
|
||||
];
|
||||
}
|
||||
$category = Category::GAME_ROOT;
|
||||
if ($id && \in_array($id, array_pluck($ctmp, 'title'), false)) {
|
||||
$cat = Category::query()
|
||||
->where('title', $id)
|
||||
->where('parentid', '=', Category::GAME_ROOT)
|
||||
->first(['id']);
|
||||
$category = $cat !== null ? $cat['id'] : Category::MUSIC_ROOT;
|
||||
}
|
||||
$category = Category::query()->where('id', '=', Category::GAME_ROOT)->first();
|
||||
|
||||
$catarray = [];
|
||||
$catarray[] = $category;
|
||||
|
||||
$this->smarty->assign('catlist', $ctmp);
|
||||
$this->smarty->assign('category', $category->title);
|
||||
$this->smarty->assign('category', $category);
|
||||
$this->smarty->assign('categorytitle', $id);
|
||||
|
||||
$page = $request->has('page') ? $request->input('page') : 1;
|
||||
|
||||
@@ -69,7 +83,7 @@ class ConsoleController extends BasePageController
|
||||
} else {
|
||||
$cdata = Category::find($category);
|
||||
if ($cdata) {
|
||||
$this->smarty->assign('catname', array_first($cdata)->parent !== null ? array_first($cdata)->parent->title.' > '.array_first($cdata)->title : array_first($cdata)->title);
|
||||
$this->smarty->assign('catname', $cdata->parentid !== null ? $cdata->parent->title.' > '.$cdata->title : $cdata->title);
|
||||
} else {
|
||||
$this->show404();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,11 @@ class MovieController extends BasePageController
|
||||
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $id
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showMovies(Request $request)
|
||||
public function showMovies(Request $request, $id = '')
|
||||
{
|
||||
$this->setPrefs();
|
||||
$movie = new Movie(['Settings' => $this->settings]);
|
||||
@@ -71,12 +72,20 @@ class MovieController extends BasePageController
|
||||
$moviecats = Category::getChildren(Category::MOVIE_ROOT);
|
||||
$mtmp = [];
|
||||
foreach ($moviecats as $mcat) {
|
||||
$mtmp[$mcat['id']] = $mcat;
|
||||
$mtmp[] =
|
||||
[
|
||||
'id' => $mcat->id,
|
||||
'title' => $mcat->title,
|
||||
];
|
||||
}
|
||||
|
||||
$category = $request->has('imdb') ? -1 : Category::MOVIE_ROOT;
|
||||
if ($request->has('t') && array_key_exists($request->input('t'), $mtmp)) {
|
||||
$category = $request->input('t') + 0;
|
||||
if ($id && \in_array($id, array_pluck($mtmp, 'title'), false)) {
|
||||
$cat = Category::query()
|
||||
->where('title', $id)
|
||||
->where('parentid', '=', Category::MOVIE_ROOT)
|
||||
->first(['id']);
|
||||
$category = $cat !== null ? $cat['id'] : Category::MOVIE_ROOT;
|
||||
}
|
||||
|
||||
$user = User::find(Auth::id());
|
||||
@@ -92,6 +101,7 @@ class MovieController extends BasePageController
|
||||
|
||||
$this->smarty->assign('catlist', $mtmp);
|
||||
$this->smarty->assign('category', $category);
|
||||
$this->smarty->assign('categorytitle', $id);
|
||||
|
||||
$page = $request->has('page') ? $request->input('page') : 1;
|
||||
|
||||
|
||||
@@ -11,10 +11,11 @@ class MusicController extends BasePageController
|
||||
{
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $id
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request)
|
||||
public function show(Request $request, $id = '')
|
||||
{
|
||||
$this->setPrefs();
|
||||
$music = new Music(['Settings' => $this->settings]);
|
||||
@@ -23,11 +24,20 @@ class MusicController extends BasePageController
|
||||
$musiccats = Category::getChildren(Category::MUSIC_ROOT);
|
||||
$mtmp = [];
|
||||
foreach ($musiccats as $mcat) {
|
||||
$mtmp[$mcat['id']] = $mcat;
|
||||
$mtmp[] =
|
||||
[
|
||||
'id' => $mcat->id,
|
||||
'title' => $mcat->title,
|
||||
];
|
||||
}
|
||||
|
||||
$category = Category::MUSIC_ROOT;
|
||||
if ($request->has('t') && array_key_exists($request->input('t'), $mtmp)) {
|
||||
$category = $request->input('t') + 0;
|
||||
if ($id && \in_array($id, array_pluck($mtmp, 'title'), false)) {
|
||||
$cat = Category::query()
|
||||
->where('title', $id)
|
||||
->where('parentid', '=', Category::MUSIC_ROOT)
|
||||
->first(['id']);
|
||||
$category = $cat !== null ? $cat['id'] : Category::MUSIC_ROOT;
|
||||
}
|
||||
|
||||
$catarray = [];
|
||||
@@ -35,6 +45,7 @@ class MusicController extends BasePageController
|
||||
|
||||
$this->smarty->assign('catlist', $mtmp);
|
||||
$this->smarty->assign('category', $category);
|
||||
$this->smarty->assign('categorytitle', $id);
|
||||
|
||||
$page = $request->has('page') ? $request->input('page') : 1;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
{/if}
|
||||
<hr>
|
||||
{foreach $parentcat.subcatlist as $subcat}
|
||||
<li><a href="{$smarty.const.WWW_TOP}/browse/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/audio/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{if isset($sabintegrated) && $sabintegrated !=""}<input type="button" class="nzb_multi_operations_sab btn btn-small btn-primary" value="Send to queue" />{/if}
|
||||
</div>
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$category}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/books/{$categorytitle}">List</a><br/>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<div style="text-align: center;">
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<br>
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$category}">List</a>
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$categorytitle}">List</a>
|
||||
<br/>
|
||||
</td>
|
||||
<td width="50%">
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
{/if}
|
||||
<hr>
|
||||
{foreach $parentcat.subcatlist as $subcat}
|
||||
<li><a href="{$smarty.const.WWW_TOP}/browse/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{if isset($sabintegrated) && $sabintegrated !=""}<input type="button" class="nzb_multi_operations_sab btn btn-small btn-primary" value="Send to queue" />{/if}
|
||||
</div>
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$category}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$categorytitle}">List</a><br/>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<div style="text-align: center;">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{if isset($sabintegrated) && $sabintegrated !=""}<input type="button" class="nzb_multi_operations_sab btn btn-small btn-primary" value="Send to queue" />{/if}
|
||||
</div>
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$category}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/audio/{$categorytitle}">List</a><br/>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<div style="text-align: center;">
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/books/{$categorytitle}">List</a><br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
<button type="button"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
{/if}
|
||||
<hr>
|
||||
{foreach $parentcat.subcatlist as $subcat}
|
||||
<li><a href="{$smarty.const.WWW_TOP}/browse/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$categorytitle}">List</a><br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
<button type="button"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/audio/{$categorytitle}">List</a><br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
<button type="button"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/books/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/console/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
{/if}
|
||||
<hr>
|
||||
{foreach $parentcat.subcatlist as $subcat}
|
||||
<li><a href="{$smarty.const.WWW_TOP}/browse/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/books/{$subcat.title}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/movies/{$categorytitle}">List</a><br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
<button type="button"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="nzb_multi_operations">
|
||||
View: <strong>Covers</strong> | <a
|
||||
href="{$smarty.const.WWW_TOP}/browse/{$category->title}">List</a><br/>
|
||||
href="{$smarty.const.WWW_TOP}/browse/audio/{$categorytitle}">List</a><br/>
|
||||
Check all: <input type="checkbox" class="square-all"/> <br/>
|
||||
With Selected:
|
||||
<div class="btn-group">
|
||||
|
||||
+8
-5
@@ -38,6 +38,7 @@ Route::prefix('browse')->group(function () {
|
||||
Route::get('anime/{id?}', 'AnimeController@index');
|
||||
|
||||
Route::get('books/{id?}', 'BooksController@index');
|
||||
Route::post('books/{id?}', 'BooksController@index');
|
||||
|
||||
Route::prefix('cart')->group(function () {
|
||||
Route::get('index', 'CartController@index');
|
||||
@@ -70,7 +71,9 @@ Route::get('apihelp', 'ApiHelpController@index');
|
||||
|
||||
Route::get('logout', 'Auth\LoginController@logout')->name('logout');
|
||||
|
||||
Route::get('console', 'ConsoleController@show');
|
||||
Route::get('console/{id?}', 'ConsoleController@show');
|
||||
|
||||
Route::post('console/{id?}', 'ConsoleController@show');
|
||||
|
||||
Route::get('browsegroup', 'BrowseGroupController@show');
|
||||
|
||||
@@ -84,21 +87,21 @@ Route::post('failed', 'FailedReleasesController@show');
|
||||
|
||||
Route::get('games', 'GamesController@show');
|
||||
|
||||
Route::get('movies', 'MovieController@showMovies');
|
||||
Route::get('movies/{id?}', 'MovieController@showMovies');
|
||||
|
||||
Route::get('movie', 'MovieController@showMovie');
|
||||
|
||||
Route::get('movietrailers', 'MovieController@showTrailer');
|
||||
|
||||
Route::post('movies', 'MovieController@showMovies');
|
||||
Route::post('movies/{id?}', 'MovieController@showMovies');
|
||||
|
||||
Route::post('movie', 'MovieController@showMovie');
|
||||
|
||||
Route::post('movietrailers', 'MovieController@showTrailer');
|
||||
|
||||
Route::get('music', 'MusicController@show');
|
||||
Route::get('music/{id?}', 'MusicController@show');
|
||||
|
||||
Route::post('music', 'MusicController@show');
|
||||
Route::post('music/{id?}', 'MusicController@show');
|
||||
|
||||
Route::get('nfo', 'NfoController@showNfo');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user