Fix cross-device link error: use shutil.move instead of os.replace

This commit is contained in:
Sebastjan Artič 2026-04-28 16:15:20 +00:00
parent 02ec6f81f2
commit 6e2a13d8a3

View File

@ -69,7 +69,7 @@ def run_clip(src, dst, start, duration, mode, lang, model, style, no_subs, quali
# 2. Subtitles (opcijsko)
if no_subs:
os.replace(reframed, dst)
shutil.move(str(reframed), str(dst))
else:
cmd = [
"python3", str(SCRIPT_DIR / "subtitle.py"),
@ -82,7 +82,7 @@ def run_clip(src, dst, start, duration, mode, lang, model, style, no_subs, quali
r = subprocess.run(cmd)
if r.returncode != 0:
print(f"❌ Subtitle napaka — shranim brez", file=sys.stderr)
os.replace(reframed, dst)
shutil.move(str(reframed), str(dst))
return True
finally:
import shutil