ripose-jp / Memento

An mpv-based video player for studying Japanese
https://ripose-jp.github.io/Memento/
GNU General Public License v2.0
434 stars 21 forks source link

Error adding term Operation canceled #200

Open ElaxDev opened 4 months ago

ElaxDev commented 4 months ago

I don't know why but when I try adding a word to Anki it shows me this error and my Anki becomes unresponsive for some seconds:

image

The ankiconnect hostname and port is set correctly and mining words with yomitan in google works so the problem seems to be with Memento, it used to work fine but now it doesn't work.

ripose-jp commented 4 months ago

I can't reproduce it. Is it still happening? Sometimes this might happen because JapanesePod101 is having issues.

ElaxDev commented 3 months ago

Yes, is still happening, I'm not using JapanesePod101, I am using a local audio server

ripose-jp commented 3 months ago

The local audio server seems to work fine when adding to Anki for me. Although I can't seem to play the audio in Memento.

Maybe try giving Anki or AnkiConnect a reinstall.

BigBoyBarney commented 3 months ago

I don't know why but when I try adding a word to Anki it shows me this error and my Anki becomes unresponsive for some seconds

If you're on Linux and are using the flatpak version of Memento, you need to give it access to /tmp.

ElaxDev commented 3 months ago

I'm on windows

ripose-jp commented 3 months ago

I just got done testing and I'm not able to reproduce this on Windows either. I think it's something specific to your setup. Possibly a plugin or something. I'd run a test with a fresh install of Anki with AnkiConnect and the local audio server plugin to see if the issue persists. Alternatively you can try to disable additional plugins until you find one that might be causing the issue.

Sorry I'm not able to help more with this one at the moment.

ElaxDev commented 3 months ago

I tried it with just AnkiConnect enabled in Anki and it gives me the same error, I am not using the local audio server now, I had to reinstall Windows (and consequently Memento and Anki) and it still gives me the same error, I ran memento-debug.exe and it still doesn't work, it worked once when I was testing, although I don't know how because it gave me the error. The console gives me this output:

QCoreApplication::applicationDirPath: Please instantiate the QApplication object first
[file] Cannot open file 'C:\Users\myuser\AppData\Local\memento\input.conf': No such file or directory
Failed to open C:\Users\myuser\AppData\Local\memento\input.conf.
[input] Can't open input config file C:\Users\myuser\AppData\Local\memento\input.conf.
 (+) Video --vid=1 (*) 'ANK@Saya' (hevc 1920x1080 23.976fps)
 (+) Audio --aid=1 --alang=jpn (*) (flac 2ch 48000Hz)
 (+) Subs  --sid=1 --slang=eng (*) 'Chihiro (Modified)' (ass)
     Subs  --sid=2 --slang=eng 'FFF' (ass)
File tags:
 Title: 06 - A Conclusion to This Worthless Fight!
AO: [wasapi] 48000Hz stereo 2ch float
VO: [libmpv] 1920x1080 yuv420p10
Track added:
 (+) Video --vid=1 (*) 'ANK@Saya' (hevc 1920x1080 23.976fps)
 (+) Audio --aid=1 --alang=jpn (*) (flac 2ch 48000Hz)
     Subs  --sid=1 --slang=eng (*) 'Chihiro (Modified)' (ass)
     Subs  --sid=2 --slang=eng 'FFF' (ass)
 (+) Subs  --sid=3 '[VCB-Studio] Kono Subarashii Sekai ni Shukufuku wo! [06][Ma10p_1080p][x265_flac_aac].srt' (subrip) (external)
Screenshot: 'C:/Users/myuser/AppData/Local/Temp/memento.nwUhbZ.png'
(Paused) AV: 00:04:37 / 00:23:40 (20%) A-V:  0.000

So it seems it is taking the screenshot.

ripose-jp commented 3 months ago

Taking a screenshot isn't too interesting since Memento takes the screenshot before ever interacting with AnkiConnect. Do you mind downgrading to v1.2.1 and trying to make a card? v1.2.2 introduced a change that sends images as base64 over JSON rather than telling AnkiConnect to go into the filesystem. That's the only thing I can think might be causing this, though I wouldn't know why since I can't reproduce it.

ElaxDev commented 3 months ago

Yeah, downgrading did the trick, I don't know why it didn't work earlier.

ripose-jp commented 3 months ago

It's very strange that I can't reproduce this on any OS. At least it seems 8c0af668e1115c1dbbd68a6d497ad722c7a294a8 is the culprit. This commit fixes other issues though, so I'd rather keep it than revert it.

It would be incredibly helpful to know if this is affecting other users or how to reproduce it.

Could you post a screenshot of your Memento card template and export an example card from Anki so I can recreate your setup? https://litterbox.catbox.moe/ is a good temporary file hosting service to upload the akpg to.

ElaxDev commented 3 months ago

Sorry, I saw your comment just now, here are the screenshots of my card template:

image image

Here is an example note: https://litter.catbox.moe/m8s1rz.apkg

ripose-jp commented 3 months ago

I don't know what the deal is, but I was able to import your note into Anki just fine. After that though, it just soft locked and wouldn't let me do anything. After restarting Anki, I tried to open the deck, but it just kept showing the Processing... loading bar forever. I think this is an issue with your note type and Anki. I'd recommend trying to use a different model and deck to mine on v1.2.2 and seeing what happens. If everything works fine, I'd say there's some sort of bug in Anki with regard to your model or deck.