Commit graph

4143 commits

Author SHA1 Message Date
Damien Elmes
6578767c4e only compare to previous note type if it exists 2020-05-12 21:13:33 +10:00
Damien Elmes
b7bfe57de1 adjust sort index on save 2020-05-12 21:13:33 +10:00
Damien Elmes
c8cbc13bba start on exposing notes and individual note type methods
changes to note:

- add_note() now takes a provided deck id instead of looking it up
in the notetype
- note type use counts fetched using a single table scan
- make sure note type changes are persisted
- expose optionalness of ords in templates and fields json
2020-05-12 21:13:33 +10:00
Damien Elmes
c92b450479 rebuild rspy on sql change 2020-05-12 21:13:33 +10:00
Damien Elmes
f95fe72795 mod schema if field/templates changed
Instead of throwing an error if schema not marked as changed,
just mark it changed, as that way it can be included as part of
the same transaction.
2020-05-12 21:13:33 +10:00
Damien Elmes
eaecfca7d1 normal note types now generate a dummy card if required
In the cloze deletion case, we already created a dummy card 0 when
no cloze deletions were found. This change makes normal note types
behave the same way - if no cards would be generated, a dummy card
0 is added to allow the note to be added.

This also applies when modifying note types - it is now possible
to delete card templates even if some notes only use that template,
as a dummy card 0 will be generated for notes that end up with no
cards left.
2020-05-12 21:13:33 +10:00
Damien Elmes
db09122ec5 use default deck for new note types 2020-05-12 21:13:33 +10:00
Damien Elmes
9451d0e9ef cloze generation 2020-05-12 21:13:33 +10:00
Damien Elmes
d810ba5db9 template changes and card generation
Cloze cards are not yet supported, missing decks are not handled,
and more testing is still required.
2020-05-12 21:13:33 +10:00
Damien Elmes
3af6905ad0 fix infinite loop on unclosed {{/<% 2020-05-12 21:13:33 +10:00
Damien Elmes
0c8763edf3 cache notetypes 2020-05-12 21:13:33 +10:00
Damien Elmes
e1642c7277 use quick check instead of full integrity check on collection close 2020-05-12 21:13:33 +10:00
Damien Elmes
7ff6226a0e always fetch full notetype 2020-05-12 21:13:33 +10:00
Damien Elmes
d47e83c989 embed enum to avoid conflicts 2020-05-12 21:13:33 +10:00
Damien Elmes
6b8a45bcb6 more work towards note adding
Still a prototype at this stage - we'll likely want a caching layer
for note types, and I'm not sure of the merit of having fields in
a separate table, since they're almost always required.
2020-05-12 21:13:33 +10:00
Damien Elmes
da09c7781e handle legacy syntax in parser instead of modifying original template
Simplifies things for the caller, and ensures legacy handling doesn't
get accidentally forgotten
2020-05-12 21:13:33 +10:00
Damien Elmes
4a2256aecb the start of note adding, and note type changes 2020-05-12 21:13:33 +10:00
Damien Elmes
6e554e6585 add separate search_notes_only() 2020-05-12 21:13:33 +10:00
Damien Elmes
cbb76290c2 start work on field changes, and add search_cards to col 2020-05-12 21:13:33 +10:00
Damien Elmes
638e69af91 move note db code to storage 2020-05-12 21:13:33 +10:00
Damien Elmes
53fc3c2f9a move latex header and styling into separate files 2020-05-12 21:13:33 +10:00
Damien Elmes
3807dcacd5 native struct for CardTemplate 2020-05-12 21:13:33 +10:00
Damien Elmes
91767fc87b native struct for NoteField
ord is made optional so we can keep track of changes in the future
2020-05-12 21:13:33 +10:00
Damien Elmes
9c41210cf4 use native struct for NoteType 2020-05-12 21:13:33 +10:00
Damien Elmes
4566a35085 expose stock notetypes 2020-05-12 21:13:33 +10:00
Damien Elmes
f2e9146e52 drop legacy newBury option 2020-05-12 21:13:33 +10:00
Damien Elmes
65f12eeda2 add stock note types in backend 2020-05-12 21:13:33 +10:00
Damien Elmes
5e49ace907 add default note type translations to ftl 2020-05-12 21:13:33 +10:00
Damien Elmes
96300f5858 migrate the schema11 usages to new structs/sql queries 2020-05-12 21:13:33 +10:00
Damien Elmes
4b39a8b727 move schema11 note type code into separate file 2020-05-12 21:13:33 +10:00
Damien Elmes
475478cec5 split note types into separate tables
- store the config in protobuf instead of json
- still loading+saving in bulk for now
- code using the schema11 structs needs to be migrated
2020-05-12 21:13:33 +10:00
Damien Elmes
8b7c474642 avoid installing pyaudio on every run 2020-05-12 21:10:21 +10:00
Damien Elmes
8a423e05fe ignore empty sound tags
https://github.com/ankitects/anki/pull/612
2020-05-12 20:53:50 +10:00
Damien Elmes
9762132f10 Merge pull request #611 from evandroforks/automatically_install_pyaudio_on_make_check
Automatically install pyaudio when running make check
2020-05-12 20:44:25 +10:00
Damien Elmes
813a0f4413 Merge pull request #616 from evandroforks/also_bump_rslib_version_on_make_check
Also bump rslib version on make_check
2020-05-12 20:32:13 +10:00
Damien Elmes
546591692b Merge pull request #618 from evandroforks/add_cargo_toml_to_pyenv_cache_reset
Also reset checks.yml pyenv cache on Cargo.toml file changes
2020-05-12 20:31:56 +10:00
evandrocoan
49bb585338 Also bump rslib version on make_check
f2b1796e22
2020-05-11 13:29:12 -03:00
evandrocoan
ae8b7842d9 Also reset checks.yml pyenv cache on Cargo.toml file changes
https://github.com/ankitects/anki/pull 612
2020-05-11 13:24:57 -03:00
siikamiika
ab0671030d bust caches 2020-05-11 13:24:21 -03:00
Damien Elmes
f2b1796e22 update crate version
make check was missing this
2020-05-11 20:41:16 +10:00
Damien Elmes
27d2fb148a bump version 2020-05-11 19:28:17 +10:00
Damien Elmes
76890191c5 Revert "use isolation characters instead of direction markers in cloze handling"
This reverts commit 79a50ffb91.

Caused a regression:

https://anki.tenderapp.com/discussions/ankidesktop/41384-cloze-deletions-in-2125-and-2126
2020-05-11 19:25:49 +10:00
evandrocoan
6d07ad653b Automatically install pyaudio when running make check 2020-05-09 13:26:42 -03:00
Damien Elmes
ece19da49a avoid renaming completer_, as add-ons depend on it 2020-05-08 18:17:57 +10:00
Damien Elmes
cad3d9e74d python formatting+lints 2020-05-08 17:30:27 +10:00
Damien Elmes
36ac3244c2 fix a unit test 2020-05-08 17:27:41 +10:00
Damien Elmes
5557a13a85 stats area grouping box fix
https://anki.tenderapp.com/discussions/beta-testing/1928-cosmetic-issue
2020-05-08 16:03:29 +10:00
Damien Elmes
a1e7690f35 fix dupe search with included formatting
https://anki.tenderapp.com/discussions/ankidesktop/41286-2125-doesnt-show-duplicates
2020-05-08 15:26:45 +10:00
Damien Elmes
0cb4bb7a78 bundle socks
https://anki.tenderapp.com/discussions/ankidesktop/39801-sync-error
2020-05-08 15:26:19 +10:00
Damien Elmes
94222e8911 fix due of preview cards being reset
https://anki.tenderapp.com/discussions/ankidesktop/41243-undo-function-causes-error-in-filtered-decks
2020-05-08 15:25:54 +10:00