Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ankiconnect needs an update (media) #349

Open
slabzzz opened this issue Jun 2, 2022 · 6 comments
Open

Ankiconnect needs an update (media) #349

slabzzz opened this issue Jun 2, 2022 · 6 comments

Comments

@slabzzz
Copy link

slabzzz commented Jun 2, 2022

image

@serpro69
Copy link
Contributor

serpro69 commented Jan 8, 2024

Just noticed the same issue with the latest version of the plugin (3.5.0)
The result is - media files aren't exported along with the cards, although the console reports that media is being added:

plugin:obsidian-to-anki-plugin:66042 Requesting deletion of notes..
plugin:obsidian-to-anki-plugin:66048 Requesting addition of media...
plugin:obsidian-to-anki-plugin:66052 Adding media file:  bfe17ed2.mp3
plugin:obsidian-to-anki-plugin:66052 Adding media file:  b67e9c0a.mp3
plugin:obsidian-to-anki-plugin:66052 Adding media file:  7abb9e18.mp3
...
plugin:obsidian-to-anki-plugin:66074 Please update AnkiConnect! The way the script has added media files has changed.
    parse_requests_1 @ plugin:obsidian-to-anki-plugin:66074
    requests_1 @ plugin:obsidian-to-anki-plugin:66068
    await in requests_1 (async)
    scanVault @ plugin:obsidian-to-anki-plugin:66353
    await in scanVault (async)
    callback @ plugin:obsidian-to-anki-plugin:66395
    Oq @ app.js:1
    t.onChooseItem @ app.js:1
    t.onChooseSuggestion @ app.js:1
    t.selectSuggestion @ app.js:1
    e.useSelectedItem @ app.js:1
    (anonymous) @ app.js:1
    e.handleKey @ app.js:1
    e.onKeyEvent @ app.js:1
plugin:obsidian-to-anki-plugin:66143 Requesting cards to be moved to target deck...
plugin:obsidian-to-anki-plugin:66149 Requesting tags to be replaced...
plugin:obsidian-to-anki-plugin:66161 All done!

On anki side the AnkiConnect addon is latest version and does not detect any new updates, so I'm assuming it's the obsidian plugin that needs to be updated.

My current workaround is copying media manually to anki's collection.media directory, but that is error prone and hard to do.

@zozzzC
Copy link

zozzzC commented May 14, 2024

Has this been fixed yet? I am still getting this error. Also thanks so much for the suggestion to just manually copy paste the media files--that worked perfectly for me.

@arne314
Copy link

arne314 commented Jul 30, 2024

I had the very same problem and traced it down to a problem with my Anki installation via flatpak. ObsidianToAnki calls the AnkiConnect API /storeMediaFile endpoint with an absolute file path to the media file, which is not possible in my sandboxed flatpak environment. A simple switch to the official binary from https://apps.ankiweb.net/ solved the problem.

@serpro69
Copy link
Contributor

I had the very same problem and traced it down to a problem with my Anki installation via flatpak. ObsidianToAnki calls the AnkiConnect API /storeMediaFile endpoint with an absolute file path to the media file, which is not possible in my sandboxed flatpak environment. A simple switch to the official binary from https://apps.ankiweb.net/ solved the problem.

That's interesting.
I also have anki installed via flatpak. However, I'm fairly certain this has worked before with a flatpak'd anki, so there could still be a fix possible.

@arne314
Copy link

arne314 commented Aug 1, 2024

The /storeMediaFile endpoint also provides the option to post the raw file content as base64 instead of the file path. If ObsidianToAnki used that in the past, that might explain why it's suddenly broken for you.

@pat-richter
Copy link

I had the same issue after switching to a new system with Anki as flatpak. The "issue" is actually a security feature of flatpak. Access to the assets folder needs to be explicitly granted.

In my case flatpak override --user net.ankiweb.Anki --filesystem=~/Obsidian/99_Assets

You can check the permissions with flatpak info --show-permissions net.ankiweb.Anki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants