mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update ShowsController add show-remove option
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-04-19 DariusIII
|
||||
* Chg: Update ShowsController add show-remove option
|
||||
* Chg: Add PredbController
|
||||
* Chg: Add NzbController
|
||||
* Chg: Add MusicController
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\Release;
|
||||
use App\Models\Video;
|
||||
use Illuminate\Http\Request;
|
||||
use Blacklight\processing\tv\TV;
|
||||
@@ -77,4 +78,33 @@ class ShowsController extends BasePageController
|
||||
);
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$success = false;
|
||||
|
||||
if ($id) {
|
||||
$success = Release::removeVideoIdFromReleases($id);
|
||||
$this->smarty->assign('videoid', $id);
|
||||
}
|
||||
|
||||
$this->smarty->assign('success', $success);
|
||||
|
||||
$title = 'Remove Video and Episode IDs from Releases';
|
||||
$content = $this->smarty->fetch('show-remove.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Predb;
|
||||
use Blacklight\http\BasePage;
|
||||
|
||||
require_once dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'resources/views/themes/smarty.php';
|
||||
|
||||
$page = new BasePage();
|
||||
$page->setAdminPrefs();
|
||||
|
||||
$offset = (request()->has('offset') && ctype_digit(request()->input('offset'))) ? request()->input('offset') : 0;
|
||||
|
||||
if (request()->has('presearch')) {
|
||||
$lastSearch = request()->input('presearch');
|
||||
$parr = Predb::getAll($offset, config('nntmux.items_per_page'), request()->input('presearch'));
|
||||
} else {
|
||||
$lastSearch = '';
|
||||
$parr = Predb::getAll($offset, config('nntmux.items_per_page'));
|
||||
}
|
||||
|
||||
$page->smarty->assign('pagertotalitems', $parr['count']);
|
||||
$page->smarty->assign('pageroffset', $offset);
|
||||
$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'));
|
||||
$page->smarty->assign('pagerquerybase', WWW_TOP.'/predb.php?offset=');
|
||||
$page->smarty->assign('pagerquerysuffix', '#results');
|
||||
$page->smarty->assign('lastSearch', $lastSearch);
|
||||
|
||||
$page->smarty->assign('pager', $page->smarty->fetch('pager.tpl'));
|
||||
$page->smarty->assign('results', $parr['arr']);
|
||||
|
||||
$page->title = 'Browse PreDb';
|
||||
$page->meta_title = 'View PreDb info';
|
||||
$page->meta_keywords = 'view,predb,info,description,details';
|
||||
$page->meta_description = 'View PreDb info';
|
||||
|
||||
$page->content = $page->smarty->fetch('predb.tpl');
|
||||
$page->adminrender();
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'resources/views/themes/smarty.php';
|
||||
|
||||
use App\Models\Release;
|
||||
use Blacklight\http\BasePage;
|
||||
|
||||
$page = new BasePage();
|
||||
$page->setAdminPrefs();
|
||||
|
||||
$success = false;
|
||||
|
||||
if (request()->has('id')) {
|
||||
$success = Release::removeVideoIdFromReleases(request()->input('id'));
|
||||
$page->smarty->assign('videoid', request()->input('id'));
|
||||
}
|
||||
|
||||
$page->smarty->assign('success', $success);
|
||||
|
||||
$page->title = 'Remove Video and Episode IDs from Releases';
|
||||
$page->content = $page->smarty->fetch('show-remove.tpl');
|
||||
$page->adminrender();
|
||||
@@ -282,6 +282,8 @@ Route::middleware('admin')->prefix('admin')->group(function () {
|
||||
Route::post('show-list', 'ShowsController@index');
|
||||
Route::get('show-edit', 'ShowsController@edit');
|
||||
Route::post('show-edit', 'ShowsController@edit');
|
||||
Route::get('show-remove', 'ShowsController@destroy');
|
||||
Route::post('show-remove', 'ShowsController@destroy');
|
||||
Route::get('comments-list', 'CommentsController@index');
|
||||
Route::post('comments-list', 'CommentsController@index');
|
||||
Route::get('comments-delete/{id}', 'CommentsController@destroy');
|
||||
|
||||
Reference in New Issue
Block a user