fixing tagview
This commit is contained in:
@@ -81,6 +81,7 @@ class CategoryController extends Controller
|
|||||||
return view('video', [
|
return view('video', [
|
||||||
'video' => $video,
|
'video' => $video,
|
||||||
'related' => $category,
|
'related' => $category,
|
||||||
|
'isTag' => false,
|
||||||
'sfw' => $sfw,
|
'sfw' => $sfw,
|
||||||
'banner' => Banner::getRandom($video->isSfw())]);
|
'banner' => Banner::getRandom($video->isSfw())]);
|
||||||
}
|
}
|
||||||
|
@@ -6,9 +6,9 @@ use App\Models\Category;
|
|||||||
use App\Models\Video;
|
use App\Models\Video;
|
||||||
use App\Models\Banner;
|
use App\Models\Banner;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
||||||
use App\Http\Requests;
|
use App\Http\Requests;
|
||||||
use Cviebrock\EloquentTaggable\Services\TagService;
|
use Cviebrock\EloquentTaggable\Services\TagService;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
class TagviewController extends Controller
|
class TagviewController extends Controller
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -43,7 +43,8 @@ class TagviewController extends Controller
|
|||||||
|
|
||||||
if (is_null($id)) {
|
if (is_null($id)) {
|
||||||
$video = Video::getRandom($shortname, true);
|
$video = Video::getRandom($shortname, true);
|
||||||
if ($video instanceof HasMany) {
|
|
||||||
|
if (!($video instanceof RedirectResponse)) {
|
||||||
$video = $video->first();
|
$video = $video->first();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -244,6 +244,7 @@ public function blurryThumb() {
|
|||||||
}
|
}
|
||||||
// jetzt sind wir im tag
|
// jetzt sind wir im tag
|
||||||
$id = Video::withAnyTags($related)->filtered()->countScoped()->count()-1;
|
$id = Video::withAnyTags($related)->filtered()->countScoped()->count()-1;
|
||||||
|
|
||||||
if ($id < 0) {
|
if ($id < 0) {
|
||||||
return redirect()->back()->with('error', 'no videos found');
|
return redirect()->back()->with('error', 'no videos found');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user