Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set to remove old media directory before exporting it again to clean
Browse files Browse the repository at this point in the history
unused media.
evandrocoan committed Aug 2, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent bf9ae61 commit 44fb8eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crowd_anki/export/anki_exporter.py
Original file line number Diff line number Diff line change
@@ -84,6 +84,7 @@ def _save_changes(self, deck, is_export_child=False):
def _copy_media(self, deck, deck_directory):
media_directory = deck_directory.joinpath(MEDIA_SUBDIRECTORY_NAME)

shutil.rmtree(str(media_directory.resolve()), ignore_errors=True)
media_directory.mkdir(parents=True, exist_ok=True)

for file_src in deck.get_media_file_list():

0 comments on commit 44fb8eb

Please sign in to comment.