diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index ec76d85b..84a250f8 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -52,7 +52,7 @@ public function search (Request $request): JsonResponse { $videos = Video::search($q, function(Indexes $index, $query, $options) { $options['attributesToRetrieve'] = ['title', 'url', 'thumbnail', 'user']; $options['attributesToHighlight'] = ['title', 'user']; - $options['attributesToCrop'] = ['title:10']; + $options['attributesToCrop'] = ['title:15']; return $index->rawSearch($query, $options); }) ->orderBy('views', 'desc') diff --git a/app/Models/Video.php b/app/Models/Video.php index ba176321..4c0a0978 100644 --- a/app/Models/Video.php +++ b/app/Models/Video.php @@ -11,6 +11,7 @@ use App\Models\Traits\HasReport; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -279,10 +280,10 @@ protected function languageName(): Attribute /** * Scope a query to only include active videos. * - * @param Builder $query - * @return Builder + * @param QueryBuilder|Builder $query + * @return QueryBuilder|Builder */ - public function scopeActive(Builder $query): Builder + public function scopeActive(QueryBuilder|Builder $query): QueryBuilder|Builder { return $query->where('status', VideoStatus::PUBLIC) ->whereNotNull('uploaded_at') diff --git a/resources/js/components/Search.jsx b/resources/js/components/Search.jsx index 2621354b..9793e241 100644 --- a/resources/js/components/Search.jsx +++ b/resources/js/components/Search.jsx @@ -80,9 +80,6 @@ export default function Search ({query = '', responsive = true}) { }).catch(e => e).finally(() => setLoading(false)); }, 300), []); - const width = responsive ? 'w-100 start-0' : 'w-35 rounded-4'; - const textSize = responsive ? 'text-sm' : ''; - return ( <>
@@ -115,7 +112,7 @@ export default function Search ({query = '', responsive = true}) {
{ (showResults && search.trim() && results.total) ? -
+