The middleware automatically converts empty strings to null. We want to accept empty strings here for the search to work. Currently, the regex throws an error when a null is passed to it.
Meilisearch seems to be a bit slow sometimes for 1 character searches (300ms delay) since it tries to count the total count accurately. Normally meilisearch has a maxTotalHits of 1000, but we have it set to the number of torrents plus 1000 so that we can have accurate page counts. This causes some additional lag for the quick search which only returns the top 20 results.
Every cache entry uses approximately 12kB from some quick testing, so 2 character is ~30 MB, while 3 characters is ~1.5 GB. Only cache up to 2 characters for now as a result.
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.
- refactored from livewire to alpinejs
- this is a crudish draft but is fullly functional
- script should be moved to own alpine component in js dir
- person command and filter is simply a test and works
- fixes long time safari issue when click result just closes search and doesnt direct to URL by following:
@click.prevent Directive: Added @click.prevent="navigateTo(result.url)" to the anchor tag to handle the click event and navigate to the URL.
navigateTo Method: Added a navigateTo method in the quickSearch function to change the window location to the clicked URL.
Event Listener: Updated the init method to add a click event listener that stops propagation and navigates to the URL.