Update Bruno API test collections with latest test data:
Bookhoard.yml environment:
- Update media_item_id to current database value after recent
database recreation/schema updates
Create Media Rating test:
- Change test rating from 8 to 7 to test different rating value
for validation
These are test infrastructure updates only, no application code changes.
- Update library_id in Bookhoard environment configuration
- Add post-response script to Get Libraries (Admin) endpoint
- Script automatically extracts and saves first library_id from response
- Enables seamless API testing without manual variable updates
Updated the Bruno API test collection to include tests for the new
3-state has_cover filter functionality.
Changes:
- Added test cases for has_cover=true, has_cover=false, and has_cover
not specified to verify all three states work correctly
- Updated environment configuration to support the new filter parameter
These tests verify that the has_cover filter properly handles:
- NULL (not specified): Returns all books
- TRUE: Returns only books with cover images
- FALSE: Returns only books without cover images
This ensures the 3-state boolean implementation works correctly across
all scenarios and prevents regression of the bug where searches were
returning 0 results.
Update test data values across Bruno API collection to reflect current
database state and improve test parameter relevance:
- Environment variables: Refresh library_id and job_id UUIDs to current
database values for accurate testing
- Combined Search test: Update tags_filter from "scifi" to "fict" for
broader genre coverage and extend year_max from 2000 to 2026 for
modern title inclusivity
- Fuzzy Author Filter test: Change author_filter from "Conan" to
"orwell" for consistent author search testing
These updates ensure API tests use valid reference data that matches
the development database state.
Update test environment and request files to use different test data:
- Update job_id variable to new test job UUID
- Change search test queries from Foundation/Asimov to 1984/Orwell
- Change series search from Foundation to Haley
- Add force parameter to scanner test
These updates provide fresh test data for API testing and
demonstrate search functionality with different media items.
This commit improves the Bruno API collection with better formatting,
updated test environment variables, and automation scripts for easier
API testing workflow.
## Environment Updates
- bruno/environments/Bookhoard.yml: Updated test IDs for library_id
and job_id to reflect latest test database state
## Formatting Improvements
Updated all Bruno collection files with consistent formatting:
- bruno/highlights/Create Media Highlight.yml
- bruno/highlights/Update Media Highlight.yml
- bruno/library/Add Library Folder.yml
- bruno/library/Create Library.yml
- bruno/library/Delete Library.yml
- bruno/library/Set Library Visibility.yml
- bruno/media-items/Create Media Item.yml
- bruno/media-items/Create Media Rating.yml
- bruno/media-items/Update Media Item.yml
- bruno/media-items/Update Media Rating.yml
- bruno/media-items/search/Combined Search and Filters.yml
- bruno/notes/Create Media Note.yml
- bruno/notes/Update Media Note.yml
- bruno/progress/Update Reading Progress.yml
- bruno/user/admin/Register Admin User.yml
- bruno/user/auth/Logout User.yml
- bruno/user/auth/Refresh Token.yml
Improvements include:
- Consistent YAML structure and indentation
- Proper multiline string format for JSON bodies
- Moved auth: inherit after headers for consistency
- Added descriptive comments in request bodies
## Automation Features
Added runtime scripts to Create Library.yml:
- after-response script automatically extracts and saves library_id
from API response to environment variables
- Persists library_id for use in subsequent requests
- Reduces manual copy-paste workflow during testing
Updated request bodies with example data:
- Create Media Item.yml: Added complete example with library_id
variable reference, title, author, file_path, file_size, mime_type
- Other files: Updated with proper JSON formatting
## Benefits
- More consistent API collection structure
- Automated workflow reduces manual steps
- Better readability with proper YAML formatting
- Example data makes requests easier to understand
- Update library_id variable in Bookhoard.yml environment
- Changed to dd03d719-76c8-4398-93ec-9258d2becf85
- Refreshes test environment with current library ID
Updates the Bruno API testing environment to use a current
library ID for testing media items and search functionality.
Standardize all Bruno API request files with consistent formatting and
structure to improve maintainability and readability.
Changes include:
- Consolidate URL parameters into main URL instead of separate definitions
- Standardize quote style (double quotes throughout)
- Add proper settings section with defaults (timeout, redirects, etc.)
- Improve YAML formatting with literal style for multi-line content
- Remove redundant fields (disabled: false)
- Clean up header and body structure
- Update sequence numbers for better organization
- Add scenarios folder structure for organized test groupings
Removes obsolete Search Invalid Library ID test case.
Environment configuration updated with new library_id for testing.
These changes improve the Bruno collection's maintainability and make
it easier to create new API requests following established patterns.
Fix 1 - File modification time for created_at:
- Get file.ModTime() in processMediaFile and pass to CreateMediaItem
- Modified SQL INSERT to include created_at column
Fix 2 - Force rescan UPDATE instead of DELETE+INSERT:
- Changed force rescan logic to call updateMediaItem instead of delete + create
- Preserves created_at timestamp on force rescan
Fix 3 - GetMediaItemByFilePath filters by library_id:
- Added library_id to WHERE clause in SQL query
- Created GetMediaItemByFilePathAnyLibrary for cross-library lookups (KOReader)
- Added SetLibraryID method to MediaScanner
- Updated handler to call SetLibraryID for watch mode
Fix 4 - File deletion handling with persistent logging:
- Added fsnotify.Remove handler in WatchChanges
- Added orphan cleanup in ScanFolders after scan completes
- Created scanner_logger.go with daily log rotation (7 days)
- Logs to /app/logs/scanner-deletes-YYYY-MM-DD.log and scanner-errors-YYYY-MM-DD.log
- Individual deletes with enhanced safety logging
Note: Integration tests can now safely scan /app/uploads because
GetMediaItemByFilePath now filters by library_id, preventing
cross-library interference.
Update Bruno environment configuration with current library and job IDs
to support API testing workflows.
Changes:
- Update library_id to current active library
- Update job_id to recent scan job
- Add collection_id variable for collection testing
Variables Updated:
- library_id: 551ac19c-896a-4406-b479-353fc489b295
- job_id: 450094c6-a8f1-4125-aea7-77df80223877
- collection_id: 11e8d915-ef95-4257-98b3-b8eeacfd59b9 (new)
Impact:
- Bruno requests reference current test data
- Supports testing scan functionality
- Enables collection endpoint testing
- Maintains test environment consistency
File: bruno/environments/Bookhoard.yml
- Move all files from bruno-yaml/* to bruno/*
- Maintains existing directory structure within categories
- Updates bruno/user/auth files with OAuth2 refresh token flow
- Updates bruno/user/profile files for user profile management
- Adds bruno/dashboard/ directory with dashboard API tests
- Preserves all existing test scenarios and OpenCollection YAML format
- No functional changes - file reorganization only
- Add IMPLEMENTATION_EXACT.md with exact code changes for all phases
- Update IMPLEMENTATION_PLAN.md with clarifications on two-field approach:
- device_identifier: Serial number (Kobo) or UUID (KOReader)
- auth_token: Auto-generated API key for authentication
- Resolve all user questions with ✅ marked decisions
- Add verification steps for documentation accuracy
- Document Kobo vs KOReader registration workflow differences
- Add SQL query for token regeneration (UpdateDeviceAuthToken)
- Include TypeScript device management code
- Add Bruno API test files for all new endpoints
- Update Kobo setup documentation for URL path token approach
- Rename ebook_id environment variable to media_item_id
- Update scanner endpoint example paths and documentation
- Update library endpoint documentation
- Keep library type 'ebooks' where appropriate (valid type value)
- Remove all ebook-specific API requests (15 files deleted)
- Rename Scan Ebooks.bru to Scan Media Items.bru
- Update API paths from /api/ebooks to /api/media-items
- Update base URL and environment configuration
- Maintain all existing media-items, library, auth, and progress tests
Aligns Bruno collection with unified media-items API architecture
Standardize all Bruno environment variables to use snake_case convention
(aligned with Go naming practices) and remove duplicate camelCase variants.
Changes:
- Environment file cleanup:
- Remove: baseUrl, ebookid, fakebookid, libraryId, mediaItemId, isVisible, refreshToken
- Standardize: fakebookid → fake_book_id, isVisible → is_visible, refreshToken → refresh_token
- All variables now use consistent snake_case format
- Update all Bruno requests to use standardized variables:
- ebooks: {{ebookid}} → {{ebook_id}}
- library: {{libraryId}} → {{library_id}}
- media-items: {{mediaItemId}} → {{media_item_id}}
- visibility: {{isVisible}} → {{is_visible}}
- auth: {{refreshToken}} → {{refresh_token}}
Benefits:
- Single source of truth for each variable
- Consistent with Go naming conventions
- No ambiguity about which variable name to use
- Cleaner, more maintainable codebase
- Add missing variables to Bookmann environment:
- library_id (snake_case variant)
- media_item_id (snake_case variant)
- job_id for scan status tracking
- baseUrl (camelCase variant for compatibility)
- refreshToken to secret vars
- Remove invalid vars sections from request files
- Variables should be referenced directly from environment
- Vars sections are for request-specific overrides, not env references
- All variables now properly defined and accessible
- Convert all JSON tests to JavaScript functions for bruToJsonV2 compatibility
- Update authentication to use 'inherit' instead of manual headers
- Fix hardcoded URLs to use {{base_url}} variables
- Standardize variable syntax from {{ _.var }} to {{var}}
- Add comprehensive API documentation to all requests
- Update environment variables with missing required fields
- Apply consistent structure: meta, http method, headers, tests, vars, settings, docs
- Enhanced validation with proper error handling and field checks
- Backend: Add server-side validation with go-playground/validator/v10
- Frontend: Add toast notifications for API errors with @zerodevx/svelte-toast
- UI: Complete Tokyo Night theme redesign with modern animations
- Docs: Update COMPLETE_DOCUMENTATION.md and README.md with all enhancements
- Validation: Email format, password strength, and input sanitization
- UX: Real-time error feedback, loading states, and responsive design