mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-09-21 00:54:25 +08:00
fix(lib): prevent filename collision (#429)
* fix(lib): prevent filename collision Apparently, ManimCE can produce two different animations with the same name (i.e., the same hash). As documented, ManimGL would any produce files with the same name so this fix was needed. Closes #428 * chore(lib): update comment chore(lib): update comment * chore(tests): add test * chore(tests): remove redundant underscore * chore(docs): add changelog entry
This commit is contained in:
@ -324,15 +324,19 @@ class PresentationConfig(BaseModel): # type: ignore[misc]
|
||||
f.write(self.model_dump_json(indent=2))
|
||||
|
||||
def copy_to(
|
||||
self, folder: Path, use_cached: bool = True, include_reversed: bool = True
|
||||
self,
|
||||
folder: Path,
|
||||
use_cached: bool = True,
|
||||
include_reversed: bool = True,
|
||||
prefix: str = "",
|
||||
) -> "PresentationConfig":
|
||||
"""Copy the files to a given directory."""
|
||||
for slide_config in self.slides:
|
||||
file = slide_config.file
|
||||
rev_file = slide_config.rev_file
|
||||
|
||||
dest = folder / file.name
|
||||
rev_dest = folder / rev_file.name
|
||||
dest = folder / f"{prefix}{file.name}"
|
||||
rev_dest = folder / f"{prefix}{rev_file.name}"
|
||||
|
||||
slide_config.file = dest
|
||||
slide_config.rev_file = rev_dest
|
||||
|
Reference in New Issue
Block a user