This commit is contained in:
Ren Tatsumoto 2020-12-12 16:41:01 +00:00 committed by GitHub
parent 08f0d0cb7e
commit 9bbaf79575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@
"version": 6, "version": 6,
"params": { "params": {
"filename": "_hello.txt", "filename": "_hello.txt",
"file": "/path/to/file" "path": "/path/to/file"
} }
} }
``` ```

View File

@ -475,7 +475,7 @@ class AnkiConnect:
if data: if data:
self.deleteMediaFile(filename) self.deleteMediaFile(filename)
self.media().writeData(filename, base64.b64decode(data)) self.media().writeData(filename, base64.b64decode(data))
elif file: elif path:
self.deleteMediaFile(filename) self.deleteMediaFile(filename)
with open(path, 'rb') as f: with open(path, 'rb') as f:
data = f.read() data = f.read()