Conversation
- backend/main.py: import SUPPORTED_RAW_EXTENSIONS (was undefined, crashing every /api/upload call with a NameError) - backend/ingestion.py: store the collision-resolved on-disk filename in the DB instead of the pre-resolution name, so two RAW files that share a basename no longer collide on their darkroom copy path - backend/database.py: add migration v2 to enforce a CHECK constraint on dev_status (rebuilds the table since SQLite can't ALTER an existing column to add one), matching the documented schema - backend/main.py: parse If-None-Match as a comma-separated ETag list instead of exact string match - frontend/src/components/Settings.jsx: pass the final rebuild stats to onRebuildComplete so the toast shows the processed count - frontend/src/App.jsx: keep the lightbox "Next" control available while more photos remain to be fetched (hasMore), not just while there's already a locally-loaded next photo Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ikgwwmNzbwMSFPLUpgSSn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds database integrity constraints, fixes conditional HTTP caching for multi-tab scenarios, corrects filename tracking during ingestion, and improves lightbox pagination behavior.
Key Changes
Database (migration #2):
CHECKconstraint todev_statuscolumn to enforce valid values ('none','consideration','in_darkroom','developed')photostable using SQLite's standard 12-step procedure (table recreation with constraints)'none'during migrationBackend API:
_if_none_match_hits()helper to properly handleIf-None-Matchheaders with comma-separated ETags and wildcard (*) values/api/files/thumb/{photo_id}and/api/files/original/{photo_id}endpointsSUPPORTED_RAW_EXTENSIONSfromraw_processingmodule (cleanup)Ingestion:
organize_path()collision resolutionstored_filename(resolved fromdest_path) for DB record to keep filename in sync with filesystemFrontend:
selectedIndex < photos.length - 1 OR hasMore(infinite scroll case)onRebuildCompletecallback in Settings componentImplementation Notes
COALESCE(dev_status, 'none')to safely handle any pre-existing NULL values*)https://claude.ai/code/session_011ikgwwmNzbwMSFPLUpgSSn