Files
bookhoard/bruno/environments/Bookhoard.yml
T
john-okeefe d802236874 scanner: fix library isolation, file mtime, force rescan, and deletion handling
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.
2026-02-26 16:39:42 -05:00

37 lines
951 B
YAML

name: Bookhoard
variables:
- name: base_url
value: http://localhost:8765
- name: media_item_id
value: 02a535a4-19f8-43fa-b81b-89a226d19dd9
- name: fake_book_id
value: 123e4567-e89b-12d3-a456-426614174000
- name: user_id
value: c51118f0-31fc-4c32-827d-517d6599bf21
- name: highlight_id
value: 660f9501-f29b-51d4-b716-446655440001
- name: note_id
value: 7710a602-g29b-61d4-c716-446655440002
- name: library_id
value: 849151fb-564e-4b24-89e3-d11360789576
- name: job_id
value: 295654b3-eb4b-4e85-ac6c-9361c5821195
- name: rating
value: "5"
- name: is_visible
value: "true"
- name: library_folder
value: /app/uploads
- name: opds_base_url
value: ""
- secret: true
name: token
- secret: true
name: refresh_token
- secret: true
name: kobo_device_token
- secret: true
name: other_device_id
- name: collection_id
value: 412c03c3-0843-4bd4-b764-cc9457bb9df2