Skip to content

Commit 927ea41

Browse files
authored
Update workbench_core.py
1 parent e0ac3f5 commit 927ea41

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

workbench_core.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,45 @@ def join_via_wav_then_lame(wav_files: list[Path], output_mp3: Path, lame_bitrate
801801
if log: log(f"[join] exception: {e}")
802802
return False
803803

804+
805+
# ---- Compatibility helpers (no-op fallbacks to satisfy imports) ----
806+
try:
807+
validate_sample_rates
808+
except NameError:
809+
def validate_sample_rates(_files, _sr, _log):
810+
# Placeholder validator; real implementation is optional.
811+
return
812+
813+
try:
814+
write_cue_for_joined
815+
except NameError:
816+
def write_cue_for_joined(_joined_path, _parts, _log):
817+
# Optional artifact; skip if not provided.
818+
return
819+
820+
try:
821+
embed_id3_chapters
822+
except NameError:
823+
def embed_id3_chapters(_joined_path, _parts, _log):
824+
# Optional chapters; skip if not provided.
825+
return
826+
827+
try:
828+
write_playlist
829+
except NameError:
830+
def write_playlist(_out_dir, _files, _log, name="playlist", fmt=None):
831+
# Minimal playlist writer (M3U)
832+
try:
833+
from pathlib import Path as _P
834+
import os as _os
835+
if fmt in (None, "M3U", "Both"):
836+
m3u = _P(_out_dir) / f"{name}.m3u"
837+
m3u.write_text("\n".join(str(p) for p in _files), encoding="utf-8")
838+
if fmt in ("M3U8", "Both"):
839+
m3u8 = _P(_out_dir) / f"{name}.m3u8"
840+
m3u8.write_text("\n".join(str(p) for p in _files), encoding="utf-8")
841+
except Exception as _e:
842+
try:
843+
_log(f"write_playlist failed: {_e}")
844+
except Exception:
845+
pass

0 commit comments

Comments
 (0)