▾ modified backend/studio/modules/projects/montage.py +7 -1 Viewed
@@ -887,7 +887,13 @@ def bring_media(pid: str, comp: str) -> list[str]: 887 887 continue 888 888 dest = motion_dir ( pid ) / src 889 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 897 dest . parent . mkdir ( parents = True , exist_ok = True ) 892 898 shutil . copy2 ( origin , dest ) 893 899 if not dest . is_file ( ) :
@@ -887,7 +887,13 @@ def bring_media(pid: str, comp: str) -> list[str]: 887 continue 887 continue 888 dest = motion_dir ( pid ) / src 888 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 ( ) :