Commit Graph
3 Commits
Author SHA1 Message Date
john-okeefe 008706a7fa docs: update implementation plan with DOUBLE PRECISION and complete integration tests
Phase 6.2 implementation: Add comprehensive integration test code to plan.

Documentation Updates:
- Changed community_rating from DECIMAL(3,1) to DOUBLE PRECISION throughout plan
- Fixed function name references: processNewMediaItems → processMediaFile (correct name)
- Added complete integration test implementation (TestComicMetadataExtraction,
  TestReadingDirectionAPI, TestUniversalMetadataFields, TestComicSpecificFields)
- Replaced skeleton TestMergeMetadata with actual test code using setupTestServer
- Added context-based location markers (3 lines before/after) for easier code navigation
- Removed TODO comment reference (doesn't exist in current code)
- Updated all line number references and added plan update summary
- Verified test helper usage: setupDeviceTest for library creation

Integration Tests Added:
- Full comic metadata field testing (manga_type, reading_direction, series_count, volume,
  imprint, age_rating, community_rating as pgtype.Float8, story_arc, is_black_and_white)
- Reading direction API testing (rtl, ltr, auto filtering)
- Universal field testing for both comic and ebook libraries
- Comic-specific field testing (alternate_info JSONB, scan_information, summary, metadata_notes)

All tests use proper test_helpers pattern with setupDeviceTest and verify DOUBLE PRECISION
storage for CommunityRating field.

Relates to: Phase 6.2 integration testing documentation
2026-03-29 21:12:27 -04:00
john-okeefe 76648e1a54 docs: add comprehensive comic metadata implementation plan
Add detailed implementation plan for comic and manga metadata support including
reading direction detection, smart Calibre + ComicInfo.xml merging, and universal
metadata fields that apply to all media formats.

Implementation Plan (IMPLEMENTATION_PLAN_MERGE_METADATA_READING_DIRECTION.md):
- 10 phases covering database, data structures, merging logic, API, testing, and documentation
- Phase 1: Database schema (14 new columns, 8 indexes)
- Phase 2: Data structure updates (ComicInfo 18→29 fields, MediaMetadata +15 fields)
- Phase 3: Smart metadata merging (mergeMetadata, 8 helper functions)
- Phase 4: Media item creation (database integration)
- Phase 5: API layer updates (TypeScript types, Go handlers)
- Phase 6-10: Testing, Bruno tests, docs, build, commits
- Genre/tag processing strategy (Option A: reuse existing genre column)
- 5 universal fields apply to all formats: age_rating, series_count, volume, imprint, web_url
- Reading direction: manga_type (raw) + reading_direction (computed)

Key Design Decisions:
- Smart merging: metadata.opf priority + ComicInfo.xml fills gaps
- Genre processing: All <dc:subject> and comic genre tags go to tags array
- Reading direction computed from Manga field + language + genre heuristics
- Supports manga (RTL), webtoons/manhwa (vertical), Western comics (LTR)
- JSONB for alternate_info (flexible schema for alternate series data)

Documentation Deleted:
- BOOK_DETAIL_IMPLEMENTATION.md (superseded by new comprehensive plan)

Plan Status:
- Phases 1-5: COMPLETE
- Phases 6-10: Pending (testing, bruno tests, documentation, build, git commits)

Total: 1,970 lines of detailed implementation guidance with code examples.
2026-03-29 19:12:10 -04:00
john-okeefe 1b632a1b6e docs: add implementation plan for comprehensive comic metadata support
This document provides a complete implementation plan for extracting ALL 19
ComicInfo.xml v2.0 fields with smart metadata merging and universal metadata
support across all media types (ebooks, audiobooks, comics).

Key features planned:
- Complete ComicInfo.xml v2.0 support (all 19 fields)
- Smart metadata merging: Calibre metadata.opf + ComicInfo.xml + folder structure
- Universal metadata fields (5 fields apply to ALL formats):
  * age_rating: Content classification (Everyone, Teen, Mature, Adult)
  * series_count: Total items in series
  * volume: Collected edition/omnibus number
  * imprint: Publisher subdivision
  * web_url: Info page URLs (Goodreads, Audible, ComicVine, etc.)
- Comic-specific fields (10 fields):
  * manga_type, reading_direction: Reading direction detection
  * story_arc, scan_information, alternate_info, summary, etc.
- Genre/tag processing: ALL genres appear in tags array without duplication
  * Uses existing 'genre' column for primary genre
  * processGenresAndTags() ensures no duplicate genres in tags
  * Works for EPUB, ComicInfo.xml, PDF metadata
- 15 new database columns, 8 indexes
- Full-stack support: database → Go → API → TypeScript → frontend
- Comprehensive testing and documentation

Plan organization:
- 10 phases: Database schema → Data structures → Smart merging → API updates
- Includes detailed commit strategy with sequential git add/commit/push commands
- Testing checklist with manual verification steps
- Bruno API test specifications
- Documentation updates (user + API reference)

This plan follows PROJECT_GUIDELINES.md requirements:
- No new services or handlers (reuses existing media_scanner.go)
- Uses setupTestServer() helper for integration tests
- Includes Bruno YAML files for API testing
- Sequential git commits with detailed messages
- Reuses existing code patterns and database schema
2026-03-29 12:05:06 -04:00