Refactor shared helpers and split server into route modules#42
Merged
Conversation
- Add UnionFind class, load_image_index(), is_image_file() to utils.py - Add 9 face recognition constants to constants.py - Replace 6 inline index-loading blocks across server/similarity/embeddings - Replace inline union-find in face clustering with UnionFind class - Replace 8 hardcoded face thresholds with named constants - Remove unused imports (os, pickle, Path)
- server.py: 1679 → 167 lines (app setup, shared state, router registration) - routes_search.py: /search, /text-search, /similar, /duplicates - routes_model.py: /model, /models, /model/unload, /model/ttl - routes_status.py: /status, /recent, /index-count, /indexed-paths - routes_indexing.py: /index, /sync, /cleanup, /notify-new-image - routes_face.py: all /face-* endpoints (21 routes) - routes_volumes.py: /volume/* endpoints - Update CI, pre-push hook, and Makefile to lint route files
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.
No description provided.