Commit Graph

28 Commits

Author SHA1 Message Date
Damien Elmes
2413f286b1 bulk tag add/remove/update; canonify on note save
also remove the tag list updated hook - we'll need a better solution in
the future than having the library code call back into the GUI code
2020-05-12 21:13:34 +10:00
Damien Elmes
7bab99d873 support disabling unicode normalization in notes 2020-05-12 21:13:34 +10:00
Damien Elmes
a7a485d550 use backend for genCards() and updateFieldCache() 2020-05-12 21:13:34 +10:00
Damien Elmes
f592672fa9 add separate decks table, and start on moving deck handling to Rust
The Python tests are passing, but there are still a number of issues
to work through, and the table/protobuf schema is not yet finalized.
2020-05-12 21:13:33 +10:00
Damien Elmes
d6706e1f0e handle changed sort field index 2020-05-12 21:13:33 +10:00
Damien Elmes
6cc2bdbf87 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
f86c2dc567 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
5c3e5c672f use default deck for new note types 2020-05-12 21:13:33 +10:00
Damien Elmes
15ff279a96 cloze generation 2020-05-12 21:13:33 +10:00
Damien Elmes
83bcb084fe 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
e8f4a75bd5 always fetch full notetype 2020-05-12 21:13:33 +10:00
Damien Elmes
f75fd5335d 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
f24dc05c8d the start of note adding, and note type changes 2020-05-12 21:13:33 +10:00
Damien Elmes
cc297f1dc6 move note db code to storage 2020-05-12 21:13:33 +10:00
Damien Elmes
32bc1e88eb migrate the schema11 usages to new structs/sql queries 2020-05-12 21:13:33 +10:00
Damien Elmes
e2b978e7cb move schema11 note type code into separate file 2020-05-12 21:13:33 +10:00
Damien Elmes
805a3a710e 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
36ec7830a9 load/save note types in backend
This allows us to normalize bad data, and is the first step towards
splitting note types into separate tables.
2020-04-08 10:05:07 +10:00
Damien Elmes
c950a00610 Cow<str> workaround no longer required 2020-04-07 10:08:03 +10:00
Damien Elmes
caa513899d update rusqlite for param count assert fix 2020-04-07 08:54:57 +10:00
Damien Elmes
f52e775354 NoteTypeID 2020-03-26 15:00:24 +10:00
Damien Elmes
4ec30e412a newtype NoteID 2020-03-26 14:42:43 +10:00
Damien Elmes
39f916a23e usn newtype 2020-03-26 13:06:02 +10:00
Damien Elmes
eb89a2db3f use newtypes for distinguishing between second and millisecond stamps 2020-03-26 12:59:51 +10:00
Damien Elmes
9752de5aaa finish the remaining searches
Searches that require multiple deck or note type lookups won't perform
very well at the moment - it either needs caching or to be split up
at the DB level.

Nothing tested yet.
2020-03-20 21:15:23 +10:00
Damien Elmes
cc54e92756 move html stripping out of field_checksum into caller 2020-03-20 21:15:23 +10:00
Damien Elmes
68657c7166 field_checksum needs to strip HTML 2020-03-20 21:15:23 +10:00
Damien Elmes
47c142a74c move note code into notes.rs, add ability to rollback when unchanged 2020-03-20 21:15:23 +10:00