fixing tagview

This commit is contained in:
x
2024-06-10 00:53:19 +02:00
parent 7990870f7c
commit 05f7fa5732
3 changed files with 5 additions and 2 deletions

View File

@@ -81,6 +81,7 @@ class CategoryController extends Controller
return view('video', [
'video' => $video,
'related' => $category,
'isTag' => false,
'sfw' => $sfw,
'banner' => Banner::getRandom($video->isSfw())]);
}

View File

@@ -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 {

View File

@@ -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');
}