mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 21:29:59 -05:00
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.
This commit is contained in:
parent
b37ad92563
commit
bd15b85c86
18 changed files with 634 additions and 507 deletions
|
|
@ -369,7 +369,10 @@ async def archive_modeler(progress_callback: Callable[[int], None] = None):
|
|||
with get_db_session(commit=True) as session:
|
||||
results = session.query(FileGroup, Archive) \
|
||||
.filter(
|
||||
# Get all groups that contain an HTML file that have not been indexed.
|
||||
# Archive shares text/html with generic HTML. Unlike video/doc/zim, do NOT
|
||||
# select Archive.id IS NULL: that would re-probe every leftover HTML file
|
||||
# every refresh. Non-SingleFile HTML stays indexed=0 so apply_indexers
|
||||
# can claim it.
|
||||
FileGroup.indexed != True,
|
||||
FileGroup.mimetype == 'text/html',
|
||||
).filter(not_(FileGroup.id.in_(list(invalid_archives)))) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue