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