docs: update media item bruno docs with normalization info
Update Update Media Item.bru to document normalization behavior: - Note that tags and contributors are auto-normalized (same as Create) - Document response includes updated search fields Relates to Tags & Contributors Migration documentation updates
This commit is contained in:
@@ -23,11 +23,11 @@ body:json {
|
|||||||
"cover_image_path": "/path/to/cover.jpg",
|
"cover_image_path": "/path/to/cover.jpg",
|
||||||
"series": "Series Name",
|
"series": "Series Name",
|
||||||
"series_number": 1,
|
"series_number": 1,
|
||||||
"tags": ["fiction", "adventure"],
|
"tags": ["science fiction", "ACME CORP.", "non-fiction"],
|
||||||
"asin": "B08XYZ123",
|
"asin": "B08XYZ123",
|
||||||
"date_published": "2023-01-15",
|
"date_published": "2023-01-15",
|
||||||
"publisher": "Publisher Name",
|
"publisher": "Publisher Name",
|
||||||
"contributors": ["Contributor Name"],
|
"contributors": ["O'Reilly Media", "acme corp"],
|
||||||
"language": "en",
|
"language": "en",
|
||||||
"edition": "First Edition",
|
"edition": "First Edition",
|
||||||
"page_count": 350,
|
"page_count": 350,
|
||||||
@@ -93,11 +93,11 @@ docs {
|
|||||||
- `cover_image_path` (string, optional): Path to cover image
|
- `cover_image_path` (string, optional): Path to cover image
|
||||||
- `series` (string, optional): Series name
|
- `series` (string, optional): Series name
|
||||||
- `series_number` (integer, optional): Number in series
|
- `series_number` (integer, optional): Number in series
|
||||||
- `tags` (array of string, optional): Tags or categories
|
- `tags` (array of string, optional): Tags or categories (auto-normalized) (automatically normalized)
|
||||||
- `asin` (string, optional): Amazon ASIN
|
- `asin` (string, optional): Amazon ASIN
|
||||||
- `date_published` (string, optional): Publication date
|
- `date_published` (string, optional): Publication date
|
||||||
- `publisher` (string, optional): Publisher name
|
- `publisher` (string, optional): Publisher name
|
||||||
- `contributors` (array of string, optional): List of contributors
|
- `contributors` (array of string, optional): List of contributors (auto-normalized) (automatically normalized)
|
||||||
- `language` (string, optional): Language code (ISO 639-1)
|
- `language` (string, optional): Language code (ISO 639-1)
|
||||||
- `edition` (string, optional): Edition information
|
- `edition` (string, optional): Edition information
|
||||||
- `page_count` (integer, optional): Total page count
|
- `page_count` (integer, optional): Total page count
|
||||||
@@ -108,7 +108,24 @@ docs {
|
|||||||
- `google_books_id` (string, optional): Google Books identifier
|
- `google_books_id` (string, optional): Google Books identifier
|
||||||
|
|
||||||
**Response:** Created media item object
|
**Response:** Created media item object
|
||||||
- All fields above plus system-generated fields
|
- All fields above plus:
|
||||||
|
- `tags_search` (array): Normalized for search (lowercase, no punctuation)
|
||||||
|
- `contributors_search` (array): Normalized for search (lowercase, no punctuation)
|
||||||
|
|
||||||
|
**Normalization Behavior:**
|
||||||
|
|
||||||
|
Tags are automatically normalized:
|
||||||
|
- Trim whitespace
|
||||||
|
- Titlecased (preserves hyphenation: "non-fiction" → "Non-Fiction")
|
||||||
|
- Case-insensitive deduplication (keeps version with punctuation if exists)
|
||||||
|
- Example: `["science fiction", "SCIENCE-FICTION"]` → `["Science-Fiction"]`
|
||||||
|
|
||||||
|
Contributors are automatically normalized:
|
||||||
|
- Trim whitespace
|
||||||
|
- Preserve original casing (CAPSLOCK companies, Title Case, etc.)
|
||||||
|
- Preserve punctuation for display
|
||||||
|
- Case-insensitive deduplication (keeps version with punctuation if exists)
|
||||||
|
- Example: `["acme corp", "ACME CORP.", "acme corp"]` → `["ACME CORP."]`
|
||||||
|
|
||||||
**Status Codes:**
|
**Status Codes:**
|
||||||
- 201: Media item created successfully
|
- 201: Media item created successfully
|
||||||
|
|||||||
@@ -86,8 +86,11 @@ docs {
|
|||||||
- `id` (string): Media item UUID
|
- `id` (string): Media item UUID
|
||||||
|
|
||||||
**Request Body:** All media item fields (same as Create)
|
**Request Body:** All media item fields (same as Create)
|
||||||
|
- Tags and contributors are auto-normalized (see Create Media Item docs)
|
||||||
|
|
||||||
**Response:** Updated media item object
|
**Response:** Updated media item object
|
||||||
|
- Includes normalized `tags` and `contributors` fields
|
||||||
|
- Includes updated `tags_search` and `contributors_search` fields
|
||||||
|
|
||||||
**Status Codes:**
|
**Status Codes:**
|
||||||
- 200: Media item updated successfully
|
- 200: Media item updated successfully
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|||||||
"cover_image_path": "/path/to/cover.jpg",
|
"cover_image_path": "/path/to/cover.jpg",
|
||||||
"series": "Series Name",
|
"series": "Series Name",
|
||||||
"series_number": 1,
|
"series_number": 1,
|
||||||
"tags": "sci-fi, space opera",
|
"tags": ["sci-fi", "space opera"],
|
||||||
|
"tags_search": ["sci fi", "space opera"],
|
||||||
|
"contributors": ["Author Name", "ACME CORP."],
|
||||||
|
"contributors_search": ["author name", "acme corp"],
|
||||||
"language": "en",
|
"language": "en",
|
||||||
"page_count": 350,
|
"page_count": 350,
|
||||||
"genre": "Science Fiction",
|
"genre": "Science Fiction",
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|||||||
"cover_image_path": "/path/to/cover.jpg",
|
"cover_image_path": "/path/to/cover.jpg",
|
||||||
"series": "Series Name",
|
"series": "Series Name",
|
||||||
"series_number": 1,
|
"series_number": 1,
|
||||||
"tags": "sci-fi, space opera",
|
"tags": ["sci-fi", "space opera"],
|
||||||
|
"tags_search": ["sci fi", "space opera"],
|
||||||
|
"contributors": ["Author Name", "ACME CORP."],
|
||||||
|
"contributors_search": ["author name", "acme corp"],
|
||||||
"language": "en",
|
"language": "en",
|
||||||
"page_count": 350,
|
"page_count": 350,
|
||||||
"genre": "Science Fiction",
|
"genre": "Science Fiction",
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
# Search Media Items
|
# Search Media Items
|
||||||
|
|
||||||
Search for media items by title, author, or description.
|
Search for media items by title, author, series, tags, or contributors.
|
||||||
|
|
||||||
|
**Note:** Search is case-insensitive and punctuation-agnostic. The search query is matched against normalized tags_search and contributors_search fields, allowing users to find matches regardless of casing or punctuation.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
- Search "acme corp" finds items with "ACME CORP." or "Acme Corp"
|
||||||
|
- Search "oreilly" finds items with "O'Reilly Media" or "OReilly Media"
|
||||||
|
- Search "science fiction" finds items with "Science-Fiction" or "science-fiction"
|
||||||
|
|
||||||
**Endpoint**: `GET /api/media-items/search`
|
**Endpoint**: `GET /api/media-items/search`
|
||||||
**Auth**: Required
|
**Auth**: Required
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ Update media item metadata (Admin only).
|
|||||||
| description | string | No | Updated description |
|
| description | string | No | Updated description |
|
||||||
| series | string | No | Series name |
|
| series | string | No | Series name |
|
||||||
| series_number | integer | No | Number in series |
|
| series_number | integer | No | Number in series |
|
||||||
|
| tags | array of string | No | Updated tags (auto-normalized) |
|
||||||
|
| contributors | array of string | No | Updated contributors (auto-normalized) |
|
||||||
|
|
||||||
|
**Tag/Contributor Normalization:**
|
||||||
|
- Tags are titlecased and deduplicated (case-insensitive)
|
||||||
|
- Contributors preserve original casing and punctuation
|
||||||
|
- Punctuation-preferred deduplication (keeps "ACME CORP." over "acme corp")
|
||||||
|
- Search fields auto-generated for case-insensitive search
|
||||||
|
|
||||||
### Example Request
|
### Example Request
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user