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

Addon causes exception #21

Open
jthulhu opened this issue Mar 18, 2021 · 3 comments
Open

Addon causes exception #21

jthulhu opened this issue Mar 18, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@jthulhu
Copy link

jthulhu commented Mar 18, 2021

When trying to change the position of a javascript asset to "As External Document", save and click "Write To Templates", Anki shows the following error:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.1 Qt 5.15.1 PyQt 5.15.1
Platform: Linux
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-03-18 19:10:51
Add-ons possibly involved: ⁨Asset Manager⁩

Caught exception:
Traceback (most recent call last):
  File "/home/<user>/.local/share/Anki2/addons21/656021484/gui_config/config.py", line 56, in writeBackCurrentSetting
    write_media(self.modelId, script_data)
  File "/home/<user>/.local/share/Anki2/addons21/656021484/src/media_writer.py", line 25, in write_media
    mw.col.media.write_data(script[0], script[1].encode())
  File "anki/media.py", line 108, in write_data
  File "anki/rsbackend_gen.py", line 197, in add_media_file
  File "anki/rsbackend.py", line 267, in _run_command
anki.rsbackend.IOError: IOError { info: "Os { code: 21, kind: Other, message: \"Is a directory\" }" }

It does not occur for the other possible positions.

@hgiesel
Copy link
Owner

hgiesel commented Mar 29, 2021

Thanks for the notice,
If you don't need it right away, I'll fix it the next time I update the add-on :)

@jthulhu
Copy link
Author

jthulhu commented Mar 30, 2021

Thanks for the notice,
If you don't need it right away, I'll fix it the next time I update the add-on :)

I don't actually need it, I was just toying around to see what the add-on has to offer but writing directly into templates is exactly what I needed.
Btw, it would be cool if one asset could be used by multiple note types :-) .

@hgiesel
Copy link
Owner

hgiesel commented Mar 30, 2021

one asset [...] by multiple note types

That's a much requested feature. I'll certainly have a look at that next time I'm working on the add-on. Problem is, Asset Manager is already probably my most complex one so-far 😅 , and I'll need some time to implement it cleanly, without making everything entirely unmaintainable.

@hgiesel hgiesel added the bug Something isn't working label Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants