FEATURE: allows the backend to take a tracklis text file
This commit is contained in:
@@ -40,8 +40,10 @@ def run_split_task(task_id: str, tracklist: List[TracklistEntry], options: Dict[
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
# Build args namespace from options.
|
||||
# IMPORTANT: format is None if not specified -> core will auto-detect.
|
||||
args = SimpleNamespace(
|
||||
format=options.get("format", "mp3"),
|
||||
format=options.get("format"),
|
||||
transcode_to=options.get("transcode_to", None),
|
||||
drop_video=options.get("drop_video", False),
|
||||
drop_subs=options.get("drop_subs", False),
|
||||
@@ -70,13 +72,10 @@ def run_split_task(task_id: str, tracklist: List[TracklistEntry], options: Dict[
|
||||
task_id, progress=10, message="Starting split..."
|
||||
)
|
||||
|
||||
# Run the split
|
||||
split_audio(str(input_path), str(output_dir), tracks, args)
|
||||
|
||||
# Get output files
|
||||
output_files = FileManager.get_output_files(task_id)
|
||||
|
||||
# Final status update
|
||||
task_manager.update_task_with_progress(
|
||||
task_id,
|
||||
progress=100,
|
||||
@@ -84,7 +83,7 @@ def run_split_task(task_id: str, tracklist: List[TracklistEntry], options: Dict[
|
||||
status=TaskStatus.DONE
|
||||
)
|
||||
|
||||
# Add tracks to the task state
|
||||
# Add tracks to the task state (for download and status queries)
|
||||
task_manager.update_task(
|
||||
task_id,
|
||||
tracks=output_files
|
||||
|
||||
Reference in New Issue
Block a user