fix thumbnail generation
fix hardcoded paths a lot of minor fixes
This commit is contained in:
@@ -22,25 +22,26 @@ class VideoController extends Controller
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Request $request) {
|
||||
|
||||
if($request->has('q')){
|
||||
$needle = trim($request->input('q'));
|
||||
return view('index', [
|
||||
'videos' => Video::filtered()->withAnyTagsFuzzy($needle)
|
||||
->orderBy('id', 'asc')
|
||||
->paginate(20)->appends(['q' => $needle]),
|
||||
$videos = Video::filtered();
|
||||
if($request->has('q')) {
|
||||
$needle = trim($request->input('q'));
|
||||
$videos = $videos->withAnyTagsFuzzy($needle);
|
||||
return view('index', [
|
||||
'number_of_results' => $videos->get()->count(),
|
||||
'videos' => $videos->orderBy('id', 'ASC')->paginate(20)->appends(['q' => $needle]),
|
||||
'categories' => Category::all(),
|
||||
'q' => $needle,
|
||||
'q' => $needle
|
||||
]);
|
||||
}
|
||||
|
||||
return view('index', [
|
||||
'videos' => Video::filtered()->orderBy('id', 'ASC')->paginate(20),
|
||||
'categories' => Category::all(),
|
||||
return view('index', [
|
||||
'number_of_results' => $videos->get()->count(),
|
||||
'videos' => $videos->orderBy('id', 'ASC')->paginate(20),
|
||||
'categories' => Category::all()
|
||||
]);
|
||||
}
|
||||
|
||||
public function main(Request $request) {
|
||||
public function main(Request $request) {
|
||||
if($request->has('q')){
|
||||
$needle = trim($request->input('q'));
|
||||
return view('main', [
|
||||
@@ -181,9 +182,11 @@ class VideoController extends Controller
|
||||
#->back();
|
||||
#->with('error', 'No video with that ID found');
|
||||
|
||||
$sfw = $video->tags->contains(function($key, $tag) {
|
||||
return $tag->normalized === 'sfw';
|
||||
});
|
||||
|
||||
$sfw = $video->isSfw();
|
||||
|
||||
if(!$sfw && !file_exists(public_path() . "/thumbs/blurred/" . substr($video->file, 0, -5) . "_blurred.png"))
|
||||
$video->blurryThumb();
|
||||
|
||||
return view('video', [
|
||||
'video' => $video,
|
||||
|
@@ -38,9 +38,9 @@ Route::group(['prefix' => 'api'], function() {
|
||||
Route::group(['prefix' => 'comments'], function() {
|
||||
Route::get('/', 'CommentController@index')->middleware('auth');
|
||||
Route::get('/{id}', 'CommentController@show')->where('id', '[0-9]+')->middleware('auth');
|
||||
Route::post('{id}/edit', 'CommentController@update')->where('id', '[0-9]+')->middleware('auth');
|
||||
Route::post('{id}/delete', 'CommentController@destroy')->where('id', '[0-9]+')->middleware('auth');
|
||||
Route::post('{id}/restore', 'CommentController@restore')->where('id', '[0-9]+')->middleware('auth');
|
||||
Route::post('{id}/edit', 'CommentController@update')->where('id', '[0-9]+')->middleware('auth')->middleware('theme');
|
||||
Route::post('{id}/delete', 'CommentController@destroy')->where('id', '[0-9]+')->middleware('auth')->middleware('theme');
|
||||
Route::post('{id}/restore', 'CommentController@restore')->where('id', '[0-9]+')->middleware('auth')->middleware('theme');
|
||||
});
|
||||
|
||||
// /api/user
|
||||
@@ -76,10 +76,10 @@ Route::group(['prefix' => 'api'], function() {
|
||||
}
|
||||
return $res;
|
||||
})->where('id', '[0-9]+')->middleware('auth');
|
||||
Route::post('{id}/delete', 'VideoController@destroy')->where('id', '[0-9]+');
|
||||
Route::post('{id}/delete', 'VideoController@destroy')->where('id', '[0-9]+')->middleware('theme');
|
||||
Route::post('{id}/tag', 'VideoController@tag')->where('id', '[0-9]+');
|
||||
Route::post('{id}/untag', 'VideoController@untag')->where('id', '[0-9]+');
|
||||
#Route::post('upload', 'VideoController@store')->middleware('auth');
|
||||
Route::post('upload', 'VideoController@store')->middleware('auth');
|
||||
});
|
||||
|
||||
#Route::post('upload', 'VideoController@store');
|
||||
@@ -109,7 +109,7 @@ Route::group(["middleware" => "theme"], function() {
|
||||
Route::get('index', 'VideoController@index')->middleware('auth');
|
||||
Route::get('main', 'VideoController@main')->middleware('auth');
|
||||
Route::post('index/{id}', 'VideoController@update')->middleware('auth');
|
||||
#Route::get('upload', 'VideoController@create')->middleware('auth');
|
||||
Route::get('upload', 'VideoController@create')->middleware('auth');
|
||||
Route::get('categories', 'CategoryController@index')->middleware('auth');
|
||||
Route::get('webm', function() { return view('webm'); })->middleware('auth');
|
||||
Route::get('about', function() { return view('about'); })->middleware('auth');
|
||||
|
Reference in New Issue
Block a user