Added analyze dialog

This commit is contained in:
patben8 committed 2026-10-04 17:00:33 +02:00
1 parent 36a6df4d3b
commit e8a53eee07
9 files changed
+322 -146

No files matched your search

+2
View File
@@ -1395,6 +1395,8 @@ def analyze_preview(body: AnalyzeRequest) -> AnalyzePreview:
if track.grid_marker_count and not track.grid_locked:
out.with_grid += 1
step = _grid_step(a, track, body, exact=False)
if step.action in ("full", "bpm", "phase") or _wants_key(track, body):
out.tracks_to_analyze += 1
if step.action in ("full", "bpm", "phase"):
setattr(out, f"grid_{step.action}", getattr(out, f"grid_{step.action}") + 1)
elif step.action == "skip":
+1
View File
@@ -152,6 +152,7 @@ class AnalyzePreview(BaseModel):
OneLibrary: 1 for any track with a BPM) a flexible grid is only found when
the run reads the real grid — it is then skipped and reported."""
total: int
tracks_to_analyze: int = 0 # tracks with anything to do (grid and key overlap)
# Grid: what `plan_grid` decides per track — full / bpm / phase / skipped.
grid_full: int = 0
grid_bpm: int = 0
+4
View File
@@ -296,6 +296,10 @@ with tempfile.TemporaryDirectory() as d:
check("preview: BPM+Grid without Replace skips every gridded track",
(pv["grid_existing"], pv["grid_full"], pv["with_grid"]) == (len(single) + 1, len(bare), len(single) + 1),
str(pv))
pv = c.post("/api/tracks/analyze/preview",
json={"track_ids": ids, "bpm": True, "grid": True, "key": True, "replace_key": True}).json()
check("preview: tracks_to_analyze counts a track once for grid AND key",
pv["tracks_to_analyze"] == len(ids), str(pv))
# BPM alone, through the run.
anchors = {t: a.track_cues(t).grid_markers[0].start for t in single}