hlassiege/darylpublic Fork
⑂ d49f56d
Commits
⬇ Clone ▾
git clone https://git.rickub.com/hlassiege/daryl.git
git clone ssh://git@rickub.com/hlassiege/daryl.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

fix(montage): find beat media already staged next to the compositions

The beat brief hands Daryl the media already copied to montage/motion/media/, and he often reuses that path as data-from with a different src. bring_media only looked in the project and the library, so every motion using attached media failed to render with 'media not found'.
hlassiege committed 2026-10-22T17:54:20+02:00 Browse files
d49f56d parent: 764ddcf
modified backend/studio/modules/projects/montage.py +7 -1
@@ -887,7 +887,13 @@ def bring_media(pid: str, comp: str) -> list[str]:
887887 continue
888888 dest = motion_dir(pid) / src
889889 origin = _media_origin(pid, _attr(tag, "data-from"))
890- if origin and (not dest.is_file() or dest.stat().st_size != origin.stat().st_size):
890+ # la fiche du beat donne le média déjà copié à côté des compositions (media/<beat>-<nom>) : Daryl le
891+ # reprend souvent en data-from en lui donnant un autre src
892+ staged = _attr(tag, "data-from").replace("\\", "/").strip()
893+ if not origin and staged.startswith(f"{MEDIA_DIR}/") and ".." not in staged.split("/") \
894+ and (motion_dir(pid) / staged).is_file():
895+ origin = motion_dir(pid) / staged
896+ if origin and origin != dest and (not dest.is_file() or dest.stat().st_size != origin.stat().st_size):
891897 dest.parent.mkdir(parents=True, exist_ok=True)
892898 shutil.copy2(origin, dest)
893899 if not dest.is_file():
@@ -887,7 +887,13 @@ def bring_media(pid: str, comp: str) -> list[str]:
887 continue887 continue
888 dest = motion_dir(pid) / src888 dest = motion_dir(pid) / src
889 origin = _media_origin(pid, _attr(tag, "data-from"))889 origin = _media_origin(pid, _attr(tag, "data-from"))
890- if origin and (not dest.is_file() or dest.stat().st_size != origin.stat().st_size):890+ # la fiche du beat donne le média déjà copié à côté des compositions (media/<beat>-<nom>) : Daryl le
891+ # reprend souvent en data-from en lui donnant un autre src
892+ staged = _attr(tag, "data-from").replace("\\", "/").strip()
893+ if not origin and staged.startswith(f"{MEDIA_DIR}/") and ".." not in staged.split("/") \
894+ and (motion_dir(pid) / staged).is_file():
895+ origin = motion_dir(pid) / staged
896+ if origin and origin != dest and (not dest.is_file() or dest.stat().st_size != origin.stat().st_size):
891 dest.parent.mkdir(parents=True, exist_ok=True)897 dest.parent.mkdir(parents=True, exist_ok=True)
892 shutil.copy2(origin, dest)898 shutil.copy2(origin, dest)
893 if not dest.is_file():899 if not dest.is_file():