From bfbca675cebd696c3a2d83590b955e175924390e Mon Sep 17 00:00:00 2001 From: libraz Date: Sat, 31 May 2025 19:02:57 +0900 Subject: [PATCH] Fix progress bar update --- src/bpm_detector/cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bpm_detector/cli.py b/src/bpm_detector/cli.py index 0cb44a9..8e11894 100644 --- a/src/bpm_detector/cli.py +++ b/src/bpm_detector/cli.py @@ -321,8 +321,13 @@ def smart_progress_callback(progress: float, message: str = ""): bar = progress_bar(info.frames, args.sr) if args.progress else None def progress_callback(increment: int) -> None: + """Update progress bar to reflect absolute progress percentage.""" if bar: - bar.update(increment) + # ``increment`` represents the current percentage completed, + # so set ``bar.n`` directly and refresh to synchronize the + # visual bar with the provided value. + bar.n = increment + bar.refresh() try: results = analyzer.analyze_file(