Commit graph

784 commits

Author SHA1 Message Date
Arthur Milchior
73bd183b8b Factorize standard models to use other models
As discussed in
https://github.com/dae/anki/pull/340#issuecomment-544749153
2019-10-22 02:43:20 +02:00
Arthur Milchior
db4edf62eb Making newBasicModel private
Following @timrae's advice on the pull request #340.
2019-10-21 07:02:08 +02:00
Arthur Milchior
c14b9e2077 Creating now basic type without doing full sync
There is currently what I believe to be a small bug in anki. You can
clone a note type without doing a full sync, but you can't create
forwardReverse and forwardOptionalReverse note type without doing a
full sync. On the other hand you can clone, and even create any other
basic type without doing a full sync.

This commit simply wants to correct this.

The main trouble is that the method to create a copy of forwardReverse
and forwardOptionalReverse use a copy of the basic model, and add this
copy in the model manager BEFORE adding yet another template. This
commit corrects it by ensuring that the model is added only after all
templates are added, so that anki does not detect any change of a
template in the schema.

In order to do this, I created a method newBasicModel which creates
the basic model without adding it.

By the way, addBasicTypingModel could also use newBasicModel, and then
only change afmt. I didn't do it here because I believe that you want
the change to be minimal, and this correction would not add any
feature, only factorize the code.
2019-10-21 02:30:06 +02:00
Arthur Milchior
3f45de87b3 New cards of existing note take due value of NEW siblings
Here is a bug, how to reproduce it, and why this is a fix.

This is a way to create a new note with a due card extremly high
without any add-on, just with basic anki.

Bug
===
Create a note type with three fields One, Two, and Three and three card
type One, Two and Three such that each card is generated when the
field of the same name is filled.

Create a note with fields One and Two filled only. Review card One and
click on good. Card one should goes in learning mode. Fill the field
Three. In the browser, you'll see that card Two and Three are new, but
card Two and Three's due value are distinct. More precisely, the due
value of card Three is equal to the due value of card One; except that
in card One it's interpreted as a timestamp, while in card Three it's
interpreted as a position in the list of new card.

You'll remark by the way that the due of card Three is extremly high,
potentially more than 1000000; which may explain why so many
collection has this bug.

Fix
===
Only consider due value of new cards.
2019-10-19 06:28:10 +02:00
Damien Elmes
2e7b756000 bump version 2019-09-24 16:12:38 +10:00
Damien Elmes
6b784ae42e escape backslash in find&replace
https://anki.tenderapp.com/discussions/ankidesktop/35903-bug-find-and-replace-breaks-when-replacing-with-latexmathjax-commands
2019-09-24 15:46:26 +10:00
Damien Elmes
d46899943c fix negative due dates in filtered decks
https://anki.tenderapp.com/discussions/ankidesktop/35978-rebuilding-filtered-deck-on-experimental-v2-empties-deck-and-reschedules-to-the-year-1745

this means affected cards will not have the selected ordering applied,
but that seems preferable to the alternatives
2019-09-24 15:38:33 +10:00
Damien Elmes
241b7ea005 use locales instead of two digit lang codes
and move away from launchpad
2019-09-23 21:18:03 +10:00
Arthur Milchior
61d7c0b5d9 when sorting by easiness, put new card separately 2019-09-18 16:58:29 +02:00
Damien Elmes
8b78d326f8
Merge pull request #328 from lovac42/clearUndoOnSchedConvert
clears undo before changing schedulers
2019-08-31 11:38:07 +10:00
Damien Elmes
a609633bb7
Merge pull request #327 from Blauelf/patch-1
Prevent non-integer ivl when importing from Mnemosyne
2019-08-31 11:34:54 +10:00
lovac42
9069d282a2 clears undo before changing schedulers 2019-08-30 20:55:38 -04:00
Damien Elmes
fb5deb9063 statsbg credit/link 2019-08-31 10:47:01 +10:00
Blauelf
672e19df85
Prevent non-integer ivl when importing from Mnemosyne
A reddit user had a few issues when importing from Mnemosyne, one of which was non-integer values interpreted as "v2 scheduler bug". I assume that's the line where they originated.
https://www.reddit.com/r/Anki/comments/cxcv27/what_just_happened_cards_with_v2_scheduler_bug/
2019-08-30 14:56:44 +02:00
lovac42
a4a47a0c94 rm unnecessary step 2019-08-20 23:31:04 -04:00
lovac42
0007c98e8d Fix case sensitive field names so that 'apple' and 'Apple' both show up in drop down list when performing a search and replace. 2019-08-20 22:28:45 -04:00
Damien Elmes
442df9d668
Merge pull request #323 from SebastienGllmt/patch-1
Allow disabling timeTicks
2019-08-17 18:50:44 +10:00
Damien Elmes
4dde7b13d0 ensure random distribution of due cards for a given day in v2 sched 2019-08-17 18:45:00 +10:00
Sebastien Guillemot
a9641e50c6
Allow disabling timeTicks 2019-08-16 01:58:10 +10:00
Damien Elmes
95387af2cd cleanup recording on cancel 2019-07-14 11:19:29 +10:00
Damien Elmes
00f171e6c3 fix flag changes in browser not syncing 2019-07-09 15:16:02 +10:00
Damien Elmes
6661ba8a77 bump version 2019-06-27 10:27:31 +10:00
Damien Elmes
ce4d18aded put deck fix messages in the collection log 2019-06-27 09:46:56 +10:00
Damien Elmes
9fc4b55575 fix v2 relearning reset bug
https://anki.tenderapp.com/discussions/ankidesktop/34560-schedule-switching-bug
2019-06-14 09:15:48 +10:00
Damien Elmes
702788c8d0 bump version 2019-06-11 15:25:45 +10:00
Damien Elmes
ef10d76edb fix v2 lrn scheduling bug
https://anki.tenderapp.com/discussions/ankimobile/9714-deleting-custom-study-deck-skips-learning-step-time
2019-05-31 15:05:12 +10:00
Damien Elmes
7aba268d7a tweak type answer note type 2019-05-14 17:05:37 +10:00
Damien Elmes
bcb422beda fix learn steps being assigned on relearn in v2 2019-04-30 09:27:28 +10:00
Damien Elmes
599f57494b wrap due numbers instead of capping them, and add warning
Wrapping (mostly) preserves the original card order, and starting
at 1M makes it easier for users to find the cards with the high
due numbers even after they have wrapped.

related discussion:
https://anki.tenderapp.com/discussions/ankidesktop/33664-due-value-of-new-card-being-1000000
2019-04-29 18:17:33 +10:00
Damien Elmes
eb46a8509a bump version 2019-04-29 14:51:34 +10:00
Damien Elmes
70c584671d cleanup mpv on exit 2019-04-29 14:36:51 +10:00
Damien Elmes
9fb5a3257c daemonize helper threads so that sys.exit() during startup works
with daemonize set to False, the app hangs waiting on the helper threads
2019-04-29 14:36:44 +10:00
Damien Elmes
7df402b006 catch full mpv request queue
presumably happening if multiple requests are sent before previous
response fetch times out

Caught exception:
  File "aqt/webview.py", line 314, in handler
  File "aqt/editor.py", line 351, in <lambda>
  File "aqt/addcards.py", line 225, in afterSave
  File "aqt/addcards.py", line 231, in doClose
  File "aqt/addcards.py", line 210, in _reject
  File "anki/sound.py", line 417, in clearAudioQueue
  File "anki/sound.py", line 117, in clearQueue
  File "anki/mpv.py", line 558, in command
  File "anki/mpv.py", line 352, in _send_request
  File "anki/mpv.py", line 311, in _send_message
<class 'anki.mpv.MPVTimeoutError'>: unable to put request
2019-04-21 18:56:11 +10:00
Damien Elmes
8497da27cf ensure the list of note types is not empty
fixes an issue opening the add screen if a user manages to delete
all their note types with an add-on or a sync
2019-04-21 18:02:12 +10:00
Damien Elmes
5dd7fc8c6e another attempt to preventing mpv from accessing standard config
https://github.com/dae/anki/pull/296
2019-04-09 15:32:44 +10:00
Damien Elmes
1a5322a396 psutil may throw OSError when calling .exe()
https://anki.tenderapp.com/discussions/ankidesktop/33406-failed-to-execute-script-runanki
2019-04-08 15:56:06 +10:00
Damien Elmes
039f6bb382
Merge pull request #290 from jianli/change-chunk-by-deck-age
Fix chunk size for newer decks
2019-03-13 12:23:35 +10:00
Damien Elmes
99693fb277
Update stats.py
disable spurious pylint warning
2019-03-11 15:12:21 +10:00
Damien Elmes
cca3fcb241 bump version 2019-03-11 14:36:19 +10:00
Damien Elmes
3cf770c73c Revert "moveTemplate slightly quicker"
This reverts commit b29fd508c7.

This caused a regression:
https://github.com/dae/anki/pull/294
2019-03-11 13:49:58 +10:00
Jian Li
08e51f220f Clean up code 2019-03-10 18:20:08 -07:00
Jian Li
c4f9a35af4 Restrict bin count to 100 2019-03-10 17:30:14 -07:00
Jian Li
64064410a3 Change bin width (chunk) based on deck age 2019-03-10 17:19:16 -07:00
Jian Li
66aef160b3 Refactor chunk calculation 2019-03-10 16:37:06 -07:00
Damien Elmes
858442a4c9 bump version 2019-03-07 18:43:56 +10:00
Damien Elmes
5c03653f3f keep json in utils for add-on compat
https://anki.tenderapp.com/discussions/beta-testing/1399-anki-2110-beta#comment_47036452
2019-03-06 07:18:26 +10:00
Damien Elmes
b5d4e78b94 cleanup old mplayer instances in profile unload as well
possible fix for users still having permission errors when
renaming profiles
2019-03-05 09:01:31 +10:00
Damien Elmes
b168ce6eed add option to strip html in export 2019-03-05 08:57:53 +10:00
Damien Elmes
1c4a40a3cc strip [[type:...]] in card export 2019-03-05 08:55:57 +10:00
Damien Elmes
ebdd8dae4b tidy up unused imports 2019-03-04 17:25:19 +10:00