Skip to content

Instantly share code, notes, and snippets.

@kelciour
Created January 28, 2022 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kelciour/9f501f675fedd3ee381f3a4647e9d1e5 to your computer and use it in GitHub Desktop.
Save kelciour/9f501f675fedd3ee381f3a4647e9d1e5 to your computer and use it in GitHub Desktop.
Fix no sound on export
import os
from anki.hooks import wrap
from anki.exporting import AnkiCollectionPackageExporter
def myDoExport(self, z, path, _old):
mdir = self.col.media.dir()
ret = _old(self, z, path)
os.chdir(mdir)
return ret
AnkiCollectionPackageExporter.doExport = wrap(AnkiCollectionPackageExporter.doExport, myDoExport, "around")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment