The preceding commit added lru.Cache for the compiled-regexp cache to
match the style in pkg/sqlite/regex.go. That file's use case is
different: a small bounded cache serving a read-dominated workload. The
auto-tag regexp cache is job-scoped (so eviction buys us nothing) and
hit by every worker on every candidate (so the LRU's per-Get mutex
becomes contention, measurable under the parallel worker pool).
sync.Map's read-optimised path avoids the contention without changing
any observable behavior. Kept as a separate commit so it can be
reverted independently if upstream prefers the LRU approach — the
first commit stands on its own either way.
Replaces the per-file SQL QueryForAutoTag prefilter with an in-memory
2-rune prefix index over performers/studios/tags, preloaded once at job
start. Also:
- runs file processing through job.TaskQueue so scenes/images/
galleries tag in parallel instead of one file at a time
- keyset-paginates the query loop so batch N+1 doesn't pay the
O(offset) scan past large tables
- bulk-loads studio/tag aliases via a new optional AllAliasLoader
interface, avoiding N+1 GetAliases calls during preload
- caches compiled name regexps (same candidate names repeat across
thousands of files)
- hoists strings.ToLower(path) and allASCII(path) out of the per-
candidate match loop
- opens a fresh write txn per applied match instead of holding one
for every tagger phase
Tagger gains *AtPath methods that own the cache + txn manager, letting
the task code stay slim.
* Move filter criterion handlers into separate file
* Add related filters for image filter
* Add related filters for scene filter
* Add related filters to gallery filter
* Add related filters to movie filter
* Add related filters to performer filter
* Add related filters to studio filter
* Add related filters to tag filter
* Add scene filter to scene marker filter
* Add mockery config file
* Move basic file/folder structs to models
* Fix hack due to import loop
* Move file interfaces to models
* Move folder interfaces to models
* Move scene interfaces to models
* Move scene marker interfaces to models
* Move image interfaces to models
* Move gallery interfaces to models
* Move gallery chapter interfaces to models
* Move studio interfaces to models
* Move movie interfaces to models
* Move performer interfaces to models
* Move tag interfaces to models
* Move autotag interfaces to models
* Regenerate mocks
* Add duration to autotag finish message
* No sorting scene/image/gallery where not specified
* Use an LRU cache for sqlite regexp function
* Compile path separator regex once
* Cache objects with single letter first names
* Move finished auto-tag log
* Add more verbose logging
* Add new changelog