info: name: Fuzzy Genre Filter type: http seq: 1 http: method: GET url: "{{base_url}}/api/media-items/search" params: - name: library_id value: "{{library_id}}" type: query disabled: false - name: genre_filter value: "scifi" type: query disabled: false auth: inherit settings: encodeUrl: true timeout: 0 followRedirects: true maxRedirects: 5 docs: |- ## Fuzzy Genre Filter Filters media items by genre using fuzzy matching (tolerates typos and variations). **Method:** GET **Endpoint:** /api/media-items/search **Authentication:** Required (Bearer token) **Query Parameters:** - `library_id` (string, required): Library UUID to search within - `genre_filter` (string, required): Genre to fuzzy match (e.g., "scifi" matches "Sci-Fi", "Science Fiction") **How Fuzzy Matching Works:** - Uses PostgreSQL pg_trgm word_similarity() - Threshold: 0.3 (30% similarity) - Handles variations: "scifi" → "Sci-Fi", "Science Fiction" - Handles typos: "fantacy" → "Fantasy" - Case-insensitive **Response:** HTTP 200 (OK) ```json [ { "id": "uuid", "title": "Foundation", "author": "Asimov, Isaac", "genre": "Sci-Fi", "library_id": "uuid", "library_name": "E-Books" } ] ``` **Examples:** - `genre_filter=scifi` → Matches "Sci-Fi", "Science Fiction" - `genre_filter=fantasy` → Matches "Fantasy", "High Fantasy" - `genre_filter=mystery` → Matches "Mystery", "Mystery/Thriller" **Success Criteria:** - Status: 200 - Returns items with genres similar to the filter - Results sorted by similarity score