files: SQL FileGroup compare, stem column, drop unused discovery path (#713)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

* files: SQL FileGroup compare, stem column, drop unused discovery path

Refresh walked the tree twice (find, then stat every unchanged group),
and a two-directory refresh scanned the whole media directory.  Compare
now diffs in SQL on a TEMP table that already has mtime, accepts multiple
roots, and groups by a stored stem that is versioned so a suffix-rule
change cannot delete-and-reinsert tagged files.

Deletes refresh_discover_paths and /api/files/refresh_progress, which
nothing in production called.  Video/doc/zim modelers use the same
(no domain row OR indexed != True) gate.

* files: keep stem current on reorganize; NUL-safe find parse

Reorganize wrote the new primary_path but not stem, so the next refresh
treated the FileGroup as deleted+new and dropped tags.  GNU find now
emits NUL-delimited records so a tab or newline in a filename cannot
abort a global refresh.  Stem backfill skips the table scan once the
algorithm version matches, and runs off the event loop.  An empty roots
list is a global refresh, not invalid SQL.
This commit is contained in:
lrnselfreliance 2026-09-18 08:57:56 -06:00 • committed by GitHub
parent b37ad92563
commit 9352839106
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 809 additions and 509 deletions

View file

@ -95,7 +95,6 @@ CATALOG = [
dict(name='config/backups', method='GET', path='/api/config/backups'),
# --- files ---
dict(name='files/refresh_progress', method='GET', path='/api/files/refresh_progress', page='files'),
dict(name='files/worker_status', method='GET', path='/api/files/worker_status'),
dict(name='files/bulk_tag/progress', method='GET', path='/api/files/bulk_tag/progress'),
dict(name='files (root listing)', method='POST', path='/api/files/', body={'directories': []}, page='files'),