Commit graph

2865 commits

Author SHA1 Message Date
Damien Elmes
8b1d029eb9 support interrupting say; fix race in simple player 2020-01-21 07:28:19 +10:00
Damien Elmes
f9ca9501ac pass task manager in instead of creating a new one 2020-01-21 06:49:09 +10:00
Damien Elmes
41272674d8 add .stop() to mpv 2020-01-21 06:45:32 +10:00
Damien Elmes
7bf4c9f08f get mpv slave mode working with new API
Also move the mpv-specific hooks into AVPlayer
2020-01-20 22:01:38 +10:00
Damien Elmes
8a09d1365e minor tidyup to sound.py 2020-01-20 21:03:22 +10:00
Damien Elmes
3a427ba5b1 don't need allSounds/stripSounds in qt's sound.py 2020-01-20 20:13:01 +10:00
Damien Elmes
263a04c887 update qt/ to use the new API 2020-01-20 20:10:38 +10:00
Damien Elmes
4d3858023b add a proof of concept TTS implementation on Mac 2020-01-20 20:08:19 +10:00
Damien Elmes
b5758c2cff rework the audio player API and add a simpler player implementation
- the new API operates on AVTags so it can support TTS as well as
audio files
- added a simple "run for each file" implementation for mpv and mplayer.
- will need to test handling of unicode filenames on Windows
- the old mpv and mplayer code is currently not active
2020-01-20 20:07:11 +10:00
Damien Elmes
71fe9a015a we can depend on pyaudio being available now that the code is in qt/ 2020-01-20 19:21:24 +10:00
Damien Elmes
548ed31ef7 add a simple TTS field filter
This simply wraps the field in extra text that the frontend will
deal with. Also added some helpers for extracting and stripping
audio and TTS tags from the rendered text.
2020-01-20 19:16:24 +10:00
Damien Elmes
4a19600465 hasSound not used by anki code or add-ons 2020-01-20 09:31:28 +10:00
Damien Elmes
ca46e01ffc update translations 2020-01-19 16:58:34 +10:00
Damien Elmes
81684ecf52 fix download log newlines 2020-01-19 16:46:24 +10:00
Damien Elmes
8dfd3e93f8 fix <br> remaining when image attached to empty field 2020-01-19 16:41:39 +10:00
Damien Elmes
168cd54827 leave percent-escaped text from the editor alone
Originally added in d7339d9a27b8abd65fbcf85f809fb0089046986f;
unfortunately the change message does not describe why. Images
are handled separately, so it should theoretically not be required,
and keeping it in leads to garbled text when people include %
on their cards.

Latest report at https://anki.tenderapp.com/discussions/ankidesktop/38138-errors-in-conversion-of-latex-and-ea
2020-01-19 16:29:46 +10:00
Damien Elmes
99d596fa96 fix incorrectly logged repeat step
https://anki.tenderapp.com/discussions/ankidesktop/38130-anki-21-scheduler-misleads-on-hard-button-for-learning-cards
2020-01-19 15:41:58 +10:00
Damien Elmes
97dc39d0e0 workflow fix 2020-01-19 15:02:08 +10:00
Damien Elmes
283601768c avoid setting provided_name if not in the json 2020-01-19 14:10:48 +10:00
Damien Elmes
afe54ff6bc update add-ons even if they're disabled
If a user enables an old add-on and restarts immediately, it won't have
had a chance to update, and may raise errors that could have been
prevented if the user was running the latest version.
2020-01-19 14:04:57 +10:00
Damien Elmes
f1f5a401f2 send point version when downloading
AnkiWeb will return a 404 if add-on does not support that version
2020-01-19 13:43:16 +10:00
Damien Elmes
5646ee642a automatically disable add-ons that have been marked as incompatible 2020-01-19 13:37:55 +10:00
Damien Elmes
92c82e29e1 add write_addon_meta(); use methods for derived values 2020-01-19 13:06:53 +10:00
Damien Elmes
6f2603710e use an object for add-on metadata instead of reading the dict directly
also, sort disabled add-ons to the end
2020-01-19 12:44:53 +10:00
Damien Elmes
0a57969a44 AnkiRequestsClient -> HttpClient 2020-01-19 11:33:27 +10:00
Damien Elmes
1ff42d776c check for add-on updates once a day 2020-01-19 11:31:09 +10:00
Damien Elmes
33d02709b5 refactor add-on downloading/installing/updating
- web requests done on a background thread
- easier to use outside of the addon dialog
- gets max point version info from AnkiWeb, which we can use in
the future
2020-01-19 10:37:15 +10:00
Damien Elmes
7a28533c85 fix display errors on macOS after updating add-ons 2020-01-19 10:33:51 +10:00
Damien Elmes
369d38ff7c add type alias for httpclient callback 2020-01-19 10:06:54 +10:00
Damien Elmes
1ae2528153 add helper for background execution 2020-01-19 10:06:01 +10:00
Damien Elmes
d86b231c2b pass in a progress callback instead of http_data_did_[send|receive]
If a request is happening on a background thread, the GUI code
receiving requests on that thread can lead to a crash

Add-on downloading still to do.
2020-01-18 17:49:59 +10:00
Damien Elmes
705ab55fef move AnkiRequestsClient into its own file
It should still be accessible via anki.sync as well.
2020-01-18 15:45:14 +10:00
Damien Elmes
c525a75fa3 drop plus_one test 2020-01-17 18:54:38 -07:00
Damien Elmes
a9378b1e99 _localOffsetForDate() was broken
It was including the elapsed time of day when calculating
the offset, leading to incorrect results
2020-01-17 18:52:36 -07:00
Damien Elmes
897a7e6584 remove template/ from i18n 2020-01-17 11:14:54 +10:00
Damien Elmes
88577605de update translations 2020-01-17 11:09:24 +10:00
Damien Elmes
70061e6bfe comment out the unused legacy code 2020-01-17 10:51:36 +10:00
Damien Elmes
5d29ad51da move types.py into the files responsible for each type 2020-01-17 10:17:33 +10:00
Damien Elmes
8041ee5c52 remove unused legacy requirements code 2020-01-17 09:33:33 +10:00
Damien Elmes
55314d6d30 add context to card rendering, and rework related hooks
- the context exists for the lifecycle of one card's render,
and caches calls to things like .card() to avoid add-ons needing to
do their own cache management.
- add-ons can optionally add extra data to the context if they need
it across multiple filters
- removed card_will_render. the legacy hook is still available for
now
- card_did_render is now called only once, with both front and back
text
2020-01-17 09:30:42 +10:00
Damien Elmes
d778f9b0af i18n 2020-01-16 21:05:29 +10:00
Damien Elmes
d81d20855e need to strip sounds when FrontSide rendering deferred 2020-01-16 19:49:43 +10:00
Damien Elmes
a254b140a7 fix empty cloze message not appearing 2020-01-16 18:47:21 +10:00
Damien Elmes
21098c43b5 save filters and field name separately 2020-01-16 18:47:21 +10:00
Damien Elmes
2e8bdb580a show missing field errors in the same way as the other errors 2020-01-16 18:47:21 +10:00
Damien Elmes
52bd10063e more useful template error message 2020-01-16 18:47:21 +10:00
Damien Elmes
4ed6508e19 Merge pull request #423 from Arthur-Milchior/fixReorder
Order by creation of note
2020-01-16 18:47:12 +10:00
Arthur Milchior
4a826f67db add in contributor 2020-01-16 00:33:39 -08:00
Arthur Milchior
c4fecd9260 Order by creation of note
This commit solve a problem I actually have for some strange
reason. Here is how to reproduce the problem

1. Create a note of type Basic (and reversed card) in a deck D with front "First"
and no back
2. Wait a day (or install an add-on which show hour and minutes of
creation time in browser)
3. create a second note, with front "Last" and no back
4. In first note, add in back field "First" and delete the front field
5. Use "Empty card".
6. In the setting of the deck D, set in random order, and then back in
the "order added"
7. Review deck D. You'll see card 1 of the second note. (Don't review
it)
8. Open the browser. Show the column "due" and created. You'll see
that the first card (first) have due value 2, while it was created
before according to the created date. The card "last" have due value
1.

This is due to the fact that the value "created" is linked to note
creation, while the order is linked to the card creation time, and
card may be created after other note
2020-01-15 23:42:54 -08:00
Damien Elmes
dfcc81af08 fix formatting 2020-01-16 12:45:48 +10:00