Skip to content

Commit 144d218

Browse files
committed
Refactor audio.cpp source path handling in AudioCppManager
- Updated the logic in the `AudioCppManager` class to improve the handling of the audio.cpp source path. - Introduced a temporary variable `raw_source_path` to streamline the validation of source path metadata before converting it to an absolute path. - Enhanced error handling to ensure completeness of audio.cpp source install metadata.
1 parent d2069a3 commit 144d218

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

backend/audio_cpp_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,10 @@ async def sync_source(
514514
) -> Dict[str, Any]:
515515
"""Pull the tracked branch and rebuild an existing audio.cpp source install."""
516516
version_name = _safe_slug(str(version_entry.get("version") or "").strip())
517-
source_dir = os.path.abspath(str(version_entry.get("source_path") or "").strip())
518-
if not version_name or not source_dir:
517+
raw_source_path = str(version_entry.get("source_path") or "").strip()
518+
if not version_name or not raw_source_path:
519519
raise ValueError("audio.cpp source install metadata is incomplete")
520+
source_dir = os.path.abspath(raw_source_path)
520521

521522
build_root = os.path.realpath(self.builds_dir)
522523
source_real = os.path.realpath(source_dir)

0 commit comments

Comments
 (0)