Closed tatsumoto-ren closed 1 year ago
Looks good, could you just add a simple test case for calling this API and making sure it doesn't fail?
I can try. This repo doesn't include any docs on how to create and run tests, I'll try inferring that from the source code.
Seems like I need a program called tox
, never heard of it.
Thanks!
The extension on AnkiWeb hasn't been updated yet. It would be awesome if you uploaded a new version 🙏.
This PR adds the
getMediaDirPath
action that returns the full path to the user's collection folder.Currently Mpvacious has to rely on the
storeMediaFile
action to add new audio and images to the collection, but this proves to be problematic. When called with base64-encoded data, it may fail if the file is too big, and when called with a path to a temporary file, it may fail because Anki doesn't have access to the folder where the file is stored.With this function we would be able to send files directly to the
collection.media
folder without encoding them as base64 or using temporary files.