fixing tagview #2

This commit is contained in:
x
2024-06-10 01:10:33 +02:00
parent 05f7fa5732
commit b6d93f54ef
5 changed files with 27 additions and 13 deletions

View File

@@ -40,9 +40,9 @@ class TagviewController extends Controller
public function showVideo($shortname, $id = null)
{
// return $shortname;
$tags = app(TagService::class)->buildTagArray($shortname);
if (is_null($id)) {
$video = Video::getRandom($shortname, true);
$video = Video::getRandom($tags, true);
if (!($video instanceof RedirectResponse)) {
$video = $video->first();
@@ -54,7 +54,7 @@ class TagviewController extends Controller
} else {
// Don't filter on specific video.
// TODO: Add warning page
$video = Video::withAnyTags($shortname)->find($id);
$video = Video::withAllTags($tags)->find($id);
}
if (is_null($video)) {