Skip to content

Commit efa1691

Browse files
committed
fix: allow searching for movies/tv whose names are numbers
Searching for a number is a shortcut to searching by tmdb. Unfortunately, that means searching for movies/tv whose names are number never show up in the quick search results. Change the logic to also search by an exact name match when searching by number to additionally include shows whose names are numbers alongside the tmdb result.
1 parent ee060d5 commit efa1691

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Http/Controllers/API/QuickSearchController.php

+2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public function index(Request $request): \Illuminate\Http\JsonResponse
5252
if (preg_match('/^(\d+)$/', $query, $matches)) {
5353
$filters[] = [
5454
'tmdb_movie_id = '.$matches[1],
55+
'tmdb_movie.name = '.$matches[1],
5556
'tmdb_tv_id = '.$matches[1],
57+
'tmdb_tv.name = '.$matches[1],
5658
];
5759
$searchById = true;
5860
}

0 commit comments

Comments
 (0)