Move filename matching to collection project

This commit is contained in:
2026-07-19 18:20:20 +02:00
parent e55251c532
commit 19af3c8cc2
3 changed files with 3 additions and 2267 deletions

View File

@ -4,13 +4,13 @@
This repository maintains a local SQLite index of WCX publications. Production code lives in `scripts/`: `wcx_sync.py` scrapes site metadata, `import_site.py` imports it into SQLite, and `update_wcx.sh` coordinates synchronization, import, and OCR. OCR is split across `process_pending_ocr.py`, `check_ocr.py`, `ocr.sh`, and `parse_ocr.py`.
`scripts/schema.sql` defines the database model. Generated databases belong in `database/`, while generated scraper output belongs in `import/`; both are ignored by Git. Historical source data is stored in `migration/`. Matching requirements and design notes live in `docs/`. The main executable test/diagnostic script is `scripts/test_duration_matching.py`.
`scripts/schema.sql` defines the database model. Generated databases belong in `database/`, while generated scraper output belongs in `import/`; both are ignored by Git. Historical source data is stored in `migration/`. Database design notes live in `docs/`. The main executable test/diagnostic script is `scripts/test_duration_matching.py`.
## Architectural boundaries
The repository is currently combined, but it is intended to be split into a reference-data project and a file-management project. The reference-data project owns the database schema, metadata, OCR, imports, history, and aliases, and it is the sole writer to the reference database. File-management code may open that database only in strict read-only mode using SQLite `mode=ro`.
This repository is the reference-data project. Filename matching and `scripts/match_filenames.py` have moved to the separate `/storage/disk1/WCX-collection` repository; this repository no longer contains or runs filename matching. The reference-data project owns the database schema, metadata, OCR, imports, history, and aliases, and it is the sole writer to the reference database.
Local file status, paths, matching decisions, and collection status must never be stored in the reference database. `scripts/match_filenames.py` belongs to the future file-management part and should later move to the separate project. Any future file-management registry or database must be owned separately and may refer to `movie.id` as the stable external ID. Do not introduce a shared Python library or API without a concrete need.
WCX-collection is an external read-only consumer of the reference database and may open it only in strict read-only mode using SQLite `mode=ro`. Local file status, paths, matching decisions, and collection status must never be stored in the reference database. Any future file-management registry or database must be owned separately and may refer to `movie.id` as the stable external ID. Do not introduce a shared Python library or API without a concrete need.
## Build, Test, and Development Commands
@ -21,7 +21,6 @@ There is no build step or third-party Python package installation; scripts use P
- `scripts/migrate_csv.py --dry-run` validates legacy CSV data without modifying SQLite.
- `scripts/test_duration_matching.py` exercises duration-matching behavior against the configured database and media paths.
- `python3 -m py_compile scripts/*.py` performs a quick syntax check.
- `scripts/match_filenames.py /path/to/videos --recursive --debug` diagnoses filename matches; it requires `ffprobe`.
Use a copied test database for commands that can write data. Never recreate or overwrite `database/wcx.db` casually because it contains manually maintained metadata.