Damien Elmes
00f827f976
fix duplicate search not checking first field
...
Thanks to abdo for the initial solution. Closes #838
2020-11-30 09:27:10 +10:00
Andreas Reis
81d6d21ae3
cleanup / renames
...
・ soundRegexps → sound_regexps
・ htmlRegexps → html_media_regexps
・ HTML_TAGS → HTML_MEDIA_TAGS
・ escapeImages → escape_media_filenames + alias
・ strip_html_preserving_image_filenames → strip_html_preserving_media_filenames
2020-11-10 14:53:04 +01:00
Damien Elmes
791894d2d0
fix new clippy lints
2020-10-09 21:35:53 +10:00
Damien Elmes
7f42500e53
rename some card+note fields in backend
2020-09-01 10:24:38 +10:00
Damien Elmes
8c558e4e5d
normalize field before checking duplicates
...
https://forums.ankiweb.net/t/unicode-normalisation/2531
2020-08-23 12:09:55 +10:00
Damien Elmes
e281d8947d
ensure we don't crash on a zero field notetype
2020-08-23 12:09:36 +10:00
Damien Elmes
db92548987
fix empty cards not ignoring <br>
...
https://forums.ankiweb.net/t/bug-report-empty-cards-are-not-recognized/2555
2020-08-23 11:44:49 +10:00
Damien Elmes
724005386c
catch attempt to update missing note
...
https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/4?u=dae
2020-08-17 19:44:27 +10:00
Damien Elmes
9ec58c10ec
strip unwanted control characters when writing fields
...
closes #661
2020-07-24 09:18:05 +10:00
Damien Elmes
c5e65d02e1
add note/card removal to backend
2020-06-04 18:21:04 +10:00
Damien Elmes
ca704187c6
skip note update if unchanged
2020-06-02 13:32:36 +10:00
Damien Elmes
a3e5068952
add some syncing tests - please see alpha2 notes before syncing
2020-06-01 19:44:25 +10:00
Damien Elmes
f17dec9f2a
start on HTTP client for syncing
2020-06-01 13:57:10 +10:00
Damien Elmes
91e3256e6a
move dupe check to backend
2020-05-24 19:48:56 +10:00
Damien Elmes
5e1583df59
fix unit test bug triggered by low resolution win32 timer
...
We don't yet have a remove_note(), so just remove all cards for now.
2020-05-18 19:02:54 +10:00
Damien Elmes
14c0a5891b
fetch template and note fields in backend during normal card render
...
Saves having to serialize the note fields and q/a templates, which
is particularly a win when rendering question/answer in the browse
screen.
Also some work towards being able to preview notes without having to
commit them to the database.
2020-05-13 10:38:49 +10:00
Damien Elmes
d7f9bccd1e
rewrite DB check
...
- notes with wrong field count are now recovered instead of
being deleted
- notes with missing note types are now recovered
- notes with missing cards are now recovered
- recover_missing_deck() still needs implementing
- checks required
2020-05-12 21:13:34 +10:00
Damien Elmes
667f9e6554
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
0a87b1ef2c
support disabling unicode normalization in notes
2020-05-12 21:13:34 +10:00
Damien Elmes
85528cabc5
use backend for genCards() and updateFieldCache()
2020-05-12 21:13:34 +10:00
Damien Elmes
24ef0cc6f1
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
3b07885911
handle changed sort field index
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
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
7ff6226a0e
always fetch full notetype
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
4a2256aecb
the start of note adding, and note type changes
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
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
bca49bd054
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
68142ed32e
Cow<str> workaround no longer required
2020-04-07 10:08:03 +10:00
Damien Elmes
b0ea1c24d0
update rusqlite for param count assert fix
2020-04-07 08:54:57 +10:00
Damien Elmes
4150480709
NoteTypeID
2020-03-26 15:00:24 +10:00
Damien Elmes
3395a565a6
newtype NoteID
2020-03-26 14:42:43 +10:00
Damien Elmes
d95cb93d7a
usn newtype
2020-03-26 13:06:02 +10:00
Damien Elmes
bfc0287e51
use newtypes for distinguishing between second and millisecond stamps
2020-03-26 12:59:51 +10:00
Damien Elmes
6c469a96eb
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
490e2b3cd3
move html stripping out of field_checksum into caller
2020-03-20 21:15:23 +10:00
Damien Elmes
1b2af8054a
field_checksum needs to strip HTML
2020-03-20 21:15:23 +10:00
Damien Elmes
e72d21e09e
move note code into notes.rs, add ability to rollback when unchanged
2020-03-20 21:15:23 +10:00