Files

45 lines
1.3 KiB
Markdown

---
title: Search
tags:
- feature
- search
- tmdb
---
# Search
## Overview
Showy provides TMDB multi-search for discovering new content to add to the library.
## How It Works
1. User types a query in the [[Pages#SearchPage|SearchPage]]
2. Input is debounced via [[Hooks#useDebounce|useDebounce]]
3. `GET /entries/tmdb/search?query=&page=` called via [[API Clients|tmdb.ts]]
4. Backend proxies to TMDB `/search/multi` via [[TMDB Integration|tmdbService.searchMulti]]
5. Results returned as `TmdbPaginatedResponse<TmdbEntry>`
6. Each result checked against [[Stores|library store]] — if already in library, the local entry card is shown instead
## Library Cross-Reference
When search results are displayed, the frontend checks each TMDB result's ID against entries in the Zustand store. If a match is found (`entry.entry_ids.tmdb_id === result.id`), the local `EntryCard` is rendered with library actions instead of the "Add" button.
## People Search
People search is also available on the [[Pages#PeoplePage|PeoplePage]]:
- `GET /people/tmdb/search?query=` → TMDB person search
- Local DB search via `GET /people/search?query=`
## Discover Pages
Browse TMDB by category on [[Pages#DiscoverPage|DiscoverPage]]:
- Popular movies/TV
- Trending movies/TV
- Top-rated movies/TV
- Upcoming movies
All use infinite scrolling via [[Hooks#useTmdb|useTmdb]] hooks.