mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Added analyze dialog
This commit is contained in:
1 parent
36a6df4d3b
commit
e8a53eee07
9 files changed
+322
-146
No files matched your search
@@ -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":
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user