feat(strm): one-click STRM generation (progress-tracked task + admin endpoint)#9556
Open
okatu-loli wants to merge 8 commits into
Open
feat(strm): one-click STRM generation (progress-tracked task + admin endpoint)#9556okatu-loli wants to merge 8 commits into
okatu-loli wants to merge 8 commits into
Conversation
…nterface Introduces driver.StrmGenerator interface in internal/driver/strm.go so internal/fs can call GenerateLocal without importing the driver package. Adds resolveStarts/collectUnits/generateUnits helpers and the GenerateLocal method on *Strm; moves the SaveStrmToLocal toggle guard out of syncLocalDirWithMode (into syncLocalDir only) so manual generation works when the toggle is off as long as SaveStrmLocalPath is set.
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.
What
Adds one-click STRM generation to the Strm driver: an explicit, progress-tracked, repeatable action that walks a mount (or any subdirectory) and writes
.strm/local files to disk — instead of relying only on lazy generation during directory browsing.Changes
GenerateLocal(two-phase, progress) — refactors the tree walk into a reusable, cancellable, two-phase implementation: phase 1 scans viafs.Listto count units, phase 2 writes files and reports progress. Exposed through a newinternal/driver.StrmGeneratorinterface to avoid an import cycle (internal/fs→ driver package).StrmGenerateTask+ manager — a non-persistedtachetask (3 workers) registered in bootstrap; resolves the Strm driver by mount path via type assertion and callsGenerateLocalwithSetProgress.POST /api/admin/strm/generate{ path }— validates the target is a Strm storage withSaveStrmLocalPathconfigured, enqueues the task, returns the task id for progress polling.rotateAllLocalunified with the same walk (drops the duplicatewalkAndSync); cancellation supported via context.Notes
SaveStrmToLocalis off, since it's an explicit action.SaveLocalMode(insert/update/sync)..strmlines go through the samebuildStrmLine/generateSignpath;?sign=is appended iff the storage'sWithSignis enabled.