- Increase ISBN column from VARCHAR(13) to VARCHAR(17) to support ISBN-13 with hyphens - Add normalize_isbn() database function to automatically remove hyphens and spaces - Create trigger to auto-normalize ISBNs on INSERT/UPDATE operations - Update all Ebook and MediaItem queries to use ISBN normalization - Add GetEbookLibraryID query to check for existing ebook libraries - Add graceful error handling when no ebook library exists - Return helpful error message: 'no ebook library found. Please create an ebook library first' - Create comprehensive tests for ISBN normalization and library selection - Add Bruno test files for various ISBN formats and error scenarios - Update documentation with ISBN normalization details
37 lines
704 B
Plaintext
37 lines
704 B
Plaintext
meta {
|
|
name: Create Ebook with Various ISBN Formats
|
|
type: http
|
|
seq: 9
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/ebooks
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"title": "Ebook with ISBN-13 (with hyphens)",
|
|
"author": "Test Author",
|
|
"isbn": "978-0-12345-678-9",
|
|
"description": "Testing ISBN normalization with hyphens",
|
|
"file_path": "/path/to/ebook1.epub",
|
|
"file_size": 1048576,
|
|
"mime_type": "application/epub+zip"
|
|
}
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Create Ebook with ISBN-13 (with hyphens)
|
|
|
|
**Expected Behavior:** ISBN should be normalized to `9780123456789`
|
|
|
|
This test demonstrates that ISBNs with hyphens are automatically normalized.
|
|
}
|