aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/request.js
diff options
context:
space:
mode:
authorsabs <sabs@sobs.moe>2019-11-09 13:51:53 -0800
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-09 20:58:09 -0500
commitfd17a0fccd54229bf071899be96dbdab3cd12f02 (patch)
tree356d2ec73af08db8d2f53ecde9274413ad3d2bf8 /ext/bg/js/request.js
parent3e864c44c379ae3c5f5c046ca2c2cd9155b6b7e0 (diff)
Remove Download check when resolving Audio data
There is a bug (seemingly unreported) in Yomichan where an Anki card will not contain any audio if the JapanesePod101 audio source trumps a secondary audio source (e.g. JapanesePod101-alternate) where the jpod101 source can't find the word requested. For example, そして has an audio entry in the alternate source but not the standard source. (Alternatively, there may be a bug in the jpod101 audioUrlBuilder, because I've only noticed this problem with hiragana-only expressions. JPod101 may not host those on the same url scheme any more. I'm not sure how to fix that, though, and the bug I'm addressing here does still persist). The reason this happens is that audioGetFromUrl uses downloaded audio to effectively check for a 404 (by examining the audio duration), but that check doesn't happen when an Anki card is being created (i.e. "download" is set, which I've changed to "willDownload" here). This change removes that check, but retains the will-download intent information to prevent attempts to download tts data, which AnkiConnect cannot do. I've also added a short explanation as to why the download check happens where it does. I think the unused audio object will get garbage collected since it's not referenced again, but I've explicitly unset it as well.
Diffstat (limited to 'ext/bg/js/request.js')
0 files changed, 0 insertions, 0 deletions