FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.04k stars 200 forks source link

Audio Filename not being sent to Anki, though the MP3 is being sent #2276

Closed ApolloFortyNine closed 1 year ago

ApolloFortyNine commented 1 year ago

Description When trying to add a new card to anki, the audio field is not being populated with the audio filename. However, the audio file is being sent to anki (visible in media collection). When testing the card template, the hasmedia function seems to think there's no audio. I've been testing mostly with this word 祝杯 , though have seen the issue with every word I've tried.

I also have the most recent version of anki and ankiconnect. No errors are seen in console when adding the card.

Browser version Both firefox and chrome (108.0.5359.95)

Yomichan version 22.10.23.0

Exported settings file yomichan-settings-2022-12-05-23-07-01.txt

Image of media explorer_f4ENHl8w3A

I saw you asked for a dump of the object previously, so here's that as well (audio is null here)

{ "marker": "test2", "definition": { "type": "termGrouped", "source": "祝杯", "rawSource": "祝杯", "sourceTerm": "祝杯", "reasons": [], "score": 208, "sequence": -1, "dictionary": "研究社 新和英大辞典 第5版", "dictionaryOrder": { "index": 0, "priority": 12 }, "dictionaryNames": [ "研究社 新和英大辞典 第5版", "JMdict (English)", "旺文社国語辞典 第十一版", "明鏡国語辞典" ], "expression": "祝杯", "reading": "しゅくはい", "expressions": [ { "sourceTerm": "祝杯", "expression": "祝杯", "reading": "しゅくはい", "termTags": [ { "name": "news", "category": "frequent", "notes": "appears frequently in Mainichi Shimbun", "order": -2, "score": 0, "dictionary": "JMdict (English)", "redundant": false }, { "name": "spec", "category": "frequent", "notes": "common words not included in frequency lists", "order": -2, "score": 0, "dictionary": "JMdict (English)", "redundant": false } ], "frequencies": [], "pitches": [], "furiganaSegments": [ { "text": "祝杯", "furigana": "しゅくはい" } ], "termFrequency": "normal", "wordClasses": [ "n" ] } ], "termTags": [ { "name": "news", "category": "frequent", "notes": "appears frequently in Mainichi Shimbun", "order": -2, "score": 0, "dictionary": "JMdict (English)", "redundant": false }, { "name": "spec", "category": "frequent", "notes": "common words not included in frequency lists", "order": -2, "score": 0, "dictionary": "JMdict (English)", "redundant": false } ], "definitions": [ { "sequence": 109441, "dictionary": "研究社 新和英大辞典 第5版", "glossary": [ "しゅくはい【祝杯】 [ローマ字](shukuhai)\na toast; a celebratory drink.\n►祝杯をあげる drink a toast 《for [to]…》; drink [toast] (to) 《sb's ┏health [success]》; drink in celebration of 《an event》\n・彼は坂本氏のために祝杯をあげようと発議した. He proposed a toast to Mr. Sakamoto.\n" ], "definitionTags": [] }, { "sequence": 1337510, "dictionary": "JMdict (English)", "glossary": [ "toast", "congratulatory cup" ], "definitionTags": [ { "name": "n", "category": "partOfSpeech", "notes": "noun (common) (futsuumeishi)", "order": -3, "score": 0, "dictionary": "JMdict (English)", "redundant": false } ] }, { "sequence": 67030, "dictionary": "旺文社国語辞典 第十一版", "glossary": [ "しゅく‐はい【祝杯・祝△盃】\n祝いのさかずき。「―をあげる」" ], "definitionTags": [] }, { "sequence": 25046, "dictionary": "明鏡国語辞典", "glossary": [ "しゅく‐はい【祝杯(祝▼盃)】〘名〙\n祝いの酒を飲むさかずき。「─をあげる」\n" ], "definitionTags": [] } ], "frequencies": [], "pitches": [], "sourceTermExactMatchCount": 1, "url": "file:///C:/Users/Ryan/Google%20Drive/Japanese/VN%20Reader%20Materials/Horizontal%20Text%20HTML.html", "cloze": { "sentence": "祝杯よ祝杯。", "prefix": "", "body": "祝杯", "suffix": "よ祝杯。" } }, "glossaryLayoutMode": "default", "compactTags": false, "group": true, "merge": false, "modeTermKanji": true, "modeTermKana": false, "modeKanji": false, "compactGlossaries": false, "uniqueExpressions": [ "祝杯" ], "uniqueReadings": [ "しゅくはい" ], "pitches": [], "pitchCount": 0, "context": { "query": "祝杯", "fullQuery": "祝杯", "document": { "title": "Texthooker" } }, "media": { "audio": null, "screenshot": null, "clipboardImage": null, "clipboardText": null, "selectionText": null, "textFurigana": [], "dictionaryMedia": {} } }
ApolloFortyNine commented 1 year ago

Maybe related to #2272 (some file access permission?)

ApolloFortyNine commented 1 year ago

Looks like it's after this line of code, perhaps ankiconnect is no longer returning filename.

https://github.com/FooSoft/yomichan/blob/a528c72107fa44c560d21c2ef0bb5589f1e82816/ext/js/background/backend.js#L1856

ApolloFortyNine commented 1 year ago

Relaunching anki fixed this issue, if this happens to anyone else.