[codex] Sync upstream updates with NAS photo-processing fixes#53
Draft
rowankid wants to merge 18 commits into
Draft
[codex] Sync upstream updates with NAS photo-processing fixes#53rowankid wants to merge 18 commits into
rowankid wants to merge 18 commits into
Conversation
…-nas-fixes # Conflicts: # package/server/app/api/toolbox.py # package/server/app/service/task_worker.py # package/server/app/service/tasks/visual_description.py
Owner
|
你更新了哪些内容 |
Owner
建议先新建一个issues,然后关联issue发起对应的pr,每次不要修改太多东西 |
There was a problem hiding this comment.
Pull request overview
This PR merges upstream master (v0.4.0-era changes) into the NAS/photo-processing branch while preserving NAS-specific operational fixes (Synology scan filters, safer task execution, improved timestamp recovery, cleanup stability, and more robust visual description handling).
Changes:
- Stabilizes cleanup pagination (backend ordering + frontend dedupe) and adds route redirects for the People album.
- Improves photo/video timestamp recovery (EXIF parsing hardening, folder/filename fallback, optional ffprobe creation_time) and adds tests for scan filters + time extraction.
- Extends server operations for NAS deployments (task worker queue/concurrency behavior, RAW companion deletion, tag merge/rename/delete APIs, and NAS compose configs).
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package/website/src/views/toolbox/CleanupPage.vue | Client-side dedupe for pagination results; adjusts skip increment based on response size. |
| package/website/src/router/index.ts | Adds /people and /people/:id redirects to /album/people. |
| package/website/src/components/home/FaceSection.vue | Updates People album navigation path. |
| package/server/app/utils/filename.py | Adds date-only filename parsing patterns (YYYY-MM-DD / YYYYMMDD). |
| package/server/app/utils/exif.py | Adds multi-source photo_time recovery pipeline (+ photo_time_source) including optional ffprobe extraction. |
| package/server/app/service/tasks/visual_description.py | Hardens JSON parsing from model responses and adds provider-specific client behavior. |
| package/server/app/service/task_worker.py | Updates queue fetch thresholds and per-category concurrency behavior. |
| package/server/app/crud/tag.py | Adds delete/rename/merge tag operations. |
| package/server/tests/test_scan_filters.py | Test coverage for Synology @eaDir scan skipping. |
| package/server/tests/test_photo_time_extraction.py | Test coverage for filename/path EXIF time extraction helpers. |
| docker-compose.nas.yml | Adds NAS-focused Docker Compose configuration and mounts. |
| docker-compose.local.yml | Adds local compose configuration. |
| .gitignore | Updates ignored runtime/state directories (e.g., pg_data, backups). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
5
| from app.service.task_strategy import BaseTaskStrategy, TaskStrategyFactory | ||
| from app.db.models.task import TaskType, DEFAULT_PRIORITIES | ||
| from typing import List, Dict | ||
| import logging | ||
| import os |
Comment on lines
382
to
+391
| # Configure max concurrency per consumer category based on system settings | ||
| # or Fast Mode. Using Semaphores to allow multiple batches to run concurrently. | ||
| max_concurrency = 1 | ||
| configured_workers = max(1, system_config.config.task.max_concurrent_tasks) | ||
| if category == 'CPU': | ||
| max_concurrency = os.cpu_count() or 4 | ||
| max_concurrency = configured_workers | ||
| elif category == 'IO': | ||
| max_concurrency = 4 | ||
| max_concurrency = configured_workers | ||
| elif category == 'AI': | ||
| max_concurrency = 1 | ||
| max_concurrency = configured_workers |
Comment on lines
+412
to
+417
| # 5. Fallback to filesystem mtime | ||
| if metadata["photo_time"] is None: | ||
| photo_time = get_file_time_form_system(file_path) | ||
| metadata["photo_time"] = photo_time | ||
| metadata["photo_time_source"] = "file_mtime" | ||
|
|
Comment on lines
+239
to
+248
| source_relations = db.query(PhotoTagRelation).filter( | ||
| PhotoTagRelation.tag_id == source.id | ||
| ).all() | ||
|
|
||
| for relation in source_relations: | ||
| target_relation = db.query(PhotoTagRelation).filter( | ||
| PhotoTagRelation.photo_id == relation.photo_id, | ||
| PhotoTagRelation.tag_id == target.id | ||
| ).first() | ||
|
|
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 merges the latest upstream
masterchanges into the NAS/photo-processing branch and keeps the local fixes that were developed while running TrailSnap on a Synology NAS.Key local fixes preserved in the merge:
@eaDirand#recyclemetadata directories during folder scansUpstream changes merged include the v0.4.0 updates, built-in AI/LLM work, toolbox organize/rename/time-from-filename features, frontend updates, and dependency bumps.
Notes
Merge conflicts were resolved in:
package/server/app/api/toolbox.pypackage/server/app/service/task_worker.pypackage/server/app/service/tasks/visual_description.pyThe task worker keeps upstream priority-aware queue fetching while preserving the conservative NAS-friendly queue/concurrency behavior.
Validation
PYTHONPATH=. ./.venv/bin/python tests/test_scan_filters.pyPYTHONPATH=. ./.venv/bin/python tests/test_photo_time_extraction.pypython -m py_compile package/server/app/api/toolbox.py package/server/app/service/task_worker.py package/server/app/service/tasks/visual_description.py package/server/app/service/tasks/scan.pypnpm -C package/website buildThe frontend build completed successfully. It still reports existing Vite warnings about stale Browserslist data, unresolved
/icon/backpack.svgat build time, mixed dynamic/static import ofsrc/stores/user.ts, and large chunks.