Commit graph

673 commits

Author SHA1 Message Date
Damien Elmes
6207b1012f Revert "use trust-dns in reqwest"
This reverts commit f15abb5c58.

trust-dns has introduced its own issues, such as when resolv.conf is
inaccessible, or contains hostnames with certain characters
2020-06-08 22:03:24 +10:00
Damien Elmes
75471224fa add progress to db check 2020-06-08 21:07:36 +10:00
Damien Elmes
e74e5c604b add daily count updating to backend 2020-06-05 19:49:53 +10:00
Damien Elmes
55f8b87548 support generating a due tree for a different date 2020-06-05 09:38:31 +10:00
Damien Elmes
c5e65d02e1 add note/card removal to backend 2020-06-04 18:21:04 +10:00
Damien Elmes
f15abb5c58 use trust-dns in reqwest
The default DNS resolution, if interrupted by an Abortable, will
cause a panic:

57ef271500/src/client/connect/dns.rs (L144)
2020-06-03 15:47:54 +10:00
Damien Elmes
cb7d78dde5 "Template" special field should have been called "Card" 2020-06-02 16:47:30 +10:00
Damien Elmes
c8b585b3e4 automatically abort the media sync on full sync 2020-06-02 16:22:53 +10:00
Damien Elmes
7dc8df748b ensure sync indicator updates after download 2020-06-02 15:10:41 +10:00
Damien Elmes
7536a3b899 fix full download on Windows 2020-06-02 15:06:23 +10:00
Damien Elmes
ca704187c6 skip note update if unchanged 2020-06-02 13:32:36 +10:00
Damien Elmes
d7a2e78c0b change sync label to indicate sync state
- blue for normal sync, red for full sync required
- refactor status fetching code so we don't hold a collection lock
during the network request, which slows things down
- fix sync spinner restarting when returning to deck list
2020-06-02 13:23:01 +10:00
Damien Elmes
42c34b60c0 use a shared async runtime instead of recreating each time 2020-06-02 09:35:27 +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
c6712cbf2c fix \n in buildhash 2020-06-01 19:38:45 +10:00
Damien Elmes
80210ab6bd handle missing counts in sanity check 2020-06-01 19:38:41 +10:00
Damien Elmes
300769aac7 if both sides empty, allow either 2020-06-01 18:11:43 +10:00
Damien Elmes
2ca3108bee don't put dyn=False in schema11 dconf's "other" 2020-06-01 18:11:40 +10:00
Damien Elmes
da2dc7bd8c tell AnkiWeb to abort on interrupt 2020-06-01 13:57:10 +10:00
Damien Elmes
ad3082d1c8 handle aborting normal sync
- Use a separate abort handle, as the media sync is running
in the background and we need to be able to target them separately.
The current progress handling is going to need a rethink if we introduce
any other background tasks in the future.
- Roll back the transaction when interrupting.
2020-06-01 13:57:10 +10:00
Damien Elmes
da1e0527ca report normal sync progress
Also:
- provide a way for the progress handler to skip the throttling so that
we can ensure progress is updated at the end of a stage
- show 'checking' at the end of full sync
2020-06-01 13:57:10 +10:00
Damien Elmes
1c52d11133 rework usn handling in sync 2020-06-01 13:57:10 +10:00
Damien Elmes
1303013ad6 add due counts to sanity check 2020-06-01 13:57:10 +10:00
Damien Elmes
0787381a99 login/full up/full down plugged in 2020-06-01 13:57:10 +10:00
Damien Elmes
aaed0464e5 rework progress handling
- client now polls status instead of backend pushing it
- supports multiple threads
- update throttling happens in one place
2020-06-01 13:57:10 +10:00
Damien Elmes
c4032c0176 another snapshot of sync work
progress handler is going to need to be reworked to function across
threads
2020-06-01 13:57:10 +10:00
Damien Elmes
b5284e8993 make sure we invalidate cache after direct update 2020-06-01 13:57:10 +10:00
Damien Elmes
2114fdf6f5 more syncing work
no checks yet
2020-06-01 13:57:10 +10:00
Damien Elmes
4d1e8d678d full upload/download HTTP code 2020-06-01 13:57:10 +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
0606bee2c5 fix rebuilding being done unnecessarily 2020-05-24 18:41:25 +10:00
Damien Elmes
e9fea26d1c use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
Damien Elmes
bbcc566e6d migrate the remaining methods 2020-05-24 08:36:50 +10:00
Damien Elmes
93f18c14d4 migrate more scheduling/media/etc
almost there
2020-05-23 21:34:19 +10:00
Damien Elmes
8b93a0c19d migrate notetypes, update GIL list 2020-05-23 20:43:55 +10:00
Damien Elmes
35489d5fa7 add some more newtypes to the RPC defs 2020-05-23 16:58:01 +10:00
Damien Elmes
8df2ab65fb migrate cards and notes 2020-05-23 16:19:48 +10:00
Damien Elmes
32a071cf79 migrate decks and dconf methods 2020-05-23 15:09:16 +10:00
Damien Elmes
927ed25b02 more methods 2020-05-23 14:01:36 +10:00
Damien Elmes
d57ded706f migrate more methods to service 2020-05-22 22:09:33 +10:00
Damien Elmes
36024ed086 start reworking protobuf handling
Will allow us to cut down on boilerplate by automatically generating
code from RPC service definitions
2020-05-22 20:56:15 +10:00
Damien Elmes
3f8a3afb78 fix extending limits in custom study
https://anki.tenderapp.com/discussions/beta-testing/1967-2126-189-g7384df8f-crash-at-note-types-fields-save
2020-05-20 14:13:40 +10:00
Damien Elmes
c78e8425aa automatically omit notes or cards table when possible 2020-05-19 11:27:02 +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
facbe53649 fix cutoff adjustment test in other timezones 2020-05-18 14:08:02 +10:00
Damien Elmes
01ebe964e9 bytes->blob in sql 2020-05-18 13:36:45 +10:00
Damien Elmes
3e156fdb49 bump version 2020-05-18 12:50:20 +10:00
Damien Elmes
4438be2c8d protobuf tidyups 2020-05-18 09:26:14 +10:00
Damien Elmes
e894125620 use empty buffer if the other map is empty in dconf 2020-05-18 08:12:27 +10:00
Damien Elmes
ef88cb59e6 fix syncing 2020-05-17 20:52:02 +10:00
Damien Elmes
e6379bc4d0 update current note type in backend 2020-05-17 20:01:16 +10:00
Damien Elmes
e230f360e9 ensure notetype name unique on add as well 2020-05-17 19:41:47 +10:00
Damien Elmes
b676522e5c fix renaming corner cases and decks.update()
- .update() should update a single deck and preserve usn by default,
as that's what existing code expects
- decks are automatically renamed when they conflict with an existing
name
2020-05-17 19:07:15 +10:00
Damien Elmes
2c19e171ed handle deletion of default deck in backend; use + instead of _ 2020-05-17 15:22:19 +10:00
Damien Elmes
336349d8d1 update before_upload() 2020-05-17 14:13:21 +10:00
Damien Elmes
a682865169 move deck config to protobuf 2020-05-17 13:28:41 +10:00
Damien Elmes
e85911c4e4 add option to limit deck tree counts to a particular node 2020-05-17 08:38:49 +10:00
Damien Elmes
17efa85d75 update rusqlite 2020-05-16 19:49:08 +10:00
Damien Elmes
e36e23b563 when merging day# in deck, make sure to reset older values 2020-05-16 15:58:25 +10:00
Damien Elmes
2e5f745b85 use the latest day when converting from legacy deck 2020-05-16 14:58:14 +10:00
Damien Elmes
70afc782ca add a unit test for deck counts 2020-05-16 14:07:48 +10:00
Damien Elmes
c60229779c switch to new deck tree in deck browser
Saves us having to look up collapsed/filtered as we render, and gives
us type completion.
2020-05-16 10:52:14 +10:00
Damien Elmes
cbfc9d5a87 handle default deck and filtered deck suppression in the backend 2020-05-15 21:21:10 +10:00
Damien Elmes
dc6471ad40 fetch stock notetypes from backend 2020-05-15 17:08:24 +10:00
Damien Elmes
91e71ae044 show (Deck) when card hasn't been added 2020-05-15 15:01:28 +10:00
Damien Elmes
8dcb7fd2ba check for empty cloze cards when rendering as well 2020-05-14 21:56:45 +10:00
Damien Elmes
6dd31341f8 add "fill empty" checkbox 2020-05-14 20:58:45 +10:00
Damien Elmes
4c52d41632 use group box instead of tabs in card layout screen 2020-05-14 17:26:40 +10:00
Damien Elmes
4a00ad075c drop availOrds(), and use backend for getting cloze numbers 2020-05-14 12:14:00 +10:00
Damien Elmes
257e893d95 update the card layout screen
- changes are now committed in bulk when closing the dialog,
and can be canceled
- it's not necessary to save the note to the database to preview it
- duplicate fields are now shown as duplicates in the top list
- redraw preview more quickly
- use + instead of _ when deduplicating names, as the latter is a
glob character
2020-05-13 17:24:49 +10:00
Damien Elmes
4815010da0 don't hide static template text when card is empty 2020-05-13 11:17:44 +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
a95fbe73c3 handle decks set to random new order
It probably makes more sense to randomize on queue build in the future,
but for now this imitates the previous Anki behaviour.
2020-05-12 21:13:34 +10:00
Damien Elmes
9c3f982c3b return resolved deck to facilitate random order mode 2020-05-12 21:13:34 +10:00
Damien Elmes
21ac2c14a7 handle scheduling preferences in the backend 2020-05-12 21:13:34 +10:00
Damien Elmes
2eaa759478 fetch timing_today() params in backend 2020-05-12 21:13:34 +10:00
Damien Elmes
1018204e4f switch server back into a bool and rely on config 2020-05-12 21:13:34 +10:00
Damien Elmes
befa66fb27 fix default rollover 2020-05-12 21:13:34 +10:00
Damien Elmes
dc9200e639 add tests for the other checks, and fix new card due limiting 2020-05-12 21:13:34 +10:00
Damien Elmes
c77bc74a2b rename SortMode arg to match enum 2020-05-12 21:13:34 +10:00
Damien Elmes
bdf5daa422 add tests for card fixes; implement deck recovery 2020-05-12 21:13:34 +10:00
Damien Elmes
c227298565 stop using memory for sqlite temp store
On large collections this can end up consuming hundreds of megabytes
of RAM on operations like a vacuum.
2020-05-12 21:13:34 +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
b03dcd2643 fetch notes in nid order
May reduce the amount of seeking on conventional disks. Chunking and
fetching batches of notes at once would improve things further, at the
cost of more memory use.
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
5d493b6ab8 add the Extra field back to cloze deletions as "Back Extra"
Originally removed because some users were adding cloze deletions to
it, but removing it just replaced that problem with a new problem where
users add the field but don't add it to their card templates.
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
8c04718541 update find&replace in browser
sadly the UI still stutters on large selections - the calls
to get the selected rows from Qt are really slow.
2020-05-12 21:13:34 +10:00
Damien Elmes
ad1c519d1c move find&replace to backend 2020-05-12 21:13:34 +10:00
Damien Elmes
2e971da79e properly handle negated conditionals outside of req generation 2020-05-12 21:13:34 +10:00
Damien Elmes
2d0a6283e4 add an index on notes(mid) so we can avoid the tablescan 2020-05-12 21:13:34 +10:00
Damien Elmes
3abd72564a fix sort field check on save 2020-05-12 21:13:33 +10:00
Damien Elmes
e32be05451 catch attempts to overwrite notetype with older version 2020-05-12 21:13:33 +10:00
Damien Elmes
7ef72aba04 use the backend for the deck due tree
- approx 3x faster on a large test deck
- counts are no longer capped to 1000 in the tree
2020-05-12 21:13:33 +10:00
Damien Elmes
267be1b050 add missing decks in backend
- need to compare parents with unicode case folding
- duplicate check enforced by the DB
2020-05-12 21:13:33 +10:00
Damien Elmes
97e857a41c add browserCollapsed as part of tree build 2020-05-12 21:13:33 +10:00
Damien Elmes
13d23cd24b speed up browser load by rendering deck tree in Rust and skipping counts 2020-05-12 21:13:33 +10:00
Damien Elmes
611959e5a8 switch primary key to deck id 2020-05-12 21:13:33 +10:00
Damien Elmes
46e0469991 rework aux table sorting
Instead of inserting text into the aux table and sorting on the fly
(which does a binary sort), we insert the ids in unicase-sorted order,
and then sort based on the automatically assigned rowids - giving
us faster sorts, and proper unicase folding.
2020-05-12 21:13:33 +10:00
Damien Elmes
c727a9e3f1 fix case sensitivity of notetype/template searches 2020-05-12 21:13:33 +10:00
Damien Elmes
c9db36bc82 update searching code to use decks table 2020-05-12 21:13:33 +10:00
Damien Elmes
87551574c0 add partial index on odid, and search odid as well
the odid != 0 check in cards_for_deck.sql is necessary for sqlite
to be able to take advantage of the index
2020-05-12 21:13:33 +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
cbfe20712e add (currently disabled) check for missing/empty decks on card add 2020-05-12 21:13:33 +10:00
Damien Elmes
082f9c95fd split decks into module 2020-05-12 21:13:33 +10:00
Damien Elmes
8481d224d6 remove notetype from cache when removing 2020-05-12 21:13:33 +10:00
Damien Elmes
2a17f99eaa remove unused _updateRequired and associated code 2020-05-12 21:13:33 +10:00
Damien Elmes
22440f32d7 remove :{} and leading/trailing whitespace from field names on save 2020-05-12 21:13:33 +10:00
Damien Elmes
d1cc4684d2 hook the empty cards code up to the GUI 2020-05-12 21:13:33 +10:00
Damien Elmes
d812853656 sort empty cards by notetype name 2020-05-12 21:13:33 +10:00
Damien Elmes
ed4c75c6c1 don't include non-empty notes in the list 2020-05-12 21:13:33 +10:00
Damien Elmes
c989e23012 handle negative due numbers when gathering existing cards 2020-05-12 21:13:33 +10:00
Damien Elmes
21d7df9473 empty card handling 2020-05-12 21:13:33 +10:00
Damien Elmes
4edeca6ed9 fix use counts not including unused note types 2020-05-12 21:13:33 +10:00
Damien Elmes
4cc070a240 note type removal 2020-05-12 21:13:33 +10:00
Damien Elmes
7106af61ff update template on field removals as well 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
549f98340a update template when fields renamed 2020-05-12 21:13:33 +10:00
Damien Elmes
8dad5cc3ab switch to owned strings in ParsedTemplate
will make it easier to cache the parsed results in the future,
and handle field renames & other transformations
2020-05-12 21:13:33 +10:00
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
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
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
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
8a423e05fe ignore empty sound tags
https://github.com/ankitects/anki/pull/612
2020-05-12 20:53:50 +10:00
evandrocoan
49bb585338 Also bump rslib version on make_check
f2b1796e22
2020-05-11 13:29:12 -03:00
Damien Elmes
f2b1796e22 update crate version
make check was missing this
2020-05-11 20:41:16 +10:00
Damien Elmes
36ac3244c2 fix a unit test 2020-05-08 17:27:41 +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
evandrocoan
d62787aa49 Fixed rspy check not being called
# Conflicts:
#	Makefile
2020-05-01 22:51:17 -03:00
Damien Elmes
2c102f87c4 update rslib version 2020-05-02 10:46:58 +10:00
Damien Elmes
4c0d80ceae tolerate decks with missing mtime exported by third party software 2020-05-02 10:18:08 +10:00
Damien Elmes
722df62452 fix some clippy lints 2020-05-02 08:55:27 +10:00
Damien Elmes
e2c57b54a2 reset due on load if outside i32 bounds
Some third party clients that create apkg files appear to be saving
a millisecond timestamp into this column. While this could also be
solved by increasing this field to a 64 bit number, some older clients
expect this column to be a 32 bit number.
2020-04-30 11:57:35 +10:00
Damien Elmes
f2876cbd42 preserve entities when stripping HTML for MathJax
https://anki.tenderapp.com/discussions/ankidesktop/40987-how-to-render-angled-brackets
2020-04-30 11:17:38 +10:00
Damien Elmes
65a9eaa418 expose clock hack via env var
closes #594
2020-04-30 09:33:02 +10:00
Damien Elmes
76d60430d9 report filename when unable to read data 2020-04-30 08:02:08 +10:00
Damien Elmes
07b9671012 don't throw an error when a file is greater than MAXPATH
https://anki.tenderapp.com/discussions/ankidesktop/40931-check-media-error
2020-04-30 08:01:45 +10:00
Damien Elmes
39070abb89 drop type answer requirement special case
While it makes no sense to have the typing box on the front without
another non-empty field, "the front of this card is empty" when
a typing box is on the template seems to be confusing some users, so
it is clearer to show them the box.
2020-04-29 21:29:16 +10:00
Damien Elmes
6d404f1999 AnkiDroid expects timer to be an integer
https://github.com/ankidroid/Anki-Android/issues/6089#issuecomment-621110598
2020-04-29 20:52:00 +10:00
evandrocoan
15deb17737 Added an warning that rslib/build.rs is automatically generated file 2020-04-29 01:21:49 -03:00
Damien Elmes
91248aa8cf bump version 2020-04-28 08:57:56 +10:00
evandrocoan
e85c48298c Fixed make clean rule not working on Windows 2020-04-26 03:02:02 -03:00
Damien Elmes
811bcda14c support globbing chars inside word boundary search 2020-04-25 09:43:08 +10:00
Damien Elmes
2f8396a951 add w: shortcut for searching on word boundaries 2020-04-25 08:48:01 +10:00
Damien Elmes
93152043e1 report the missing filename in media check
https://anki.tenderapp.com/discussions/ankidesktop/40578-check-media-error
2020-04-17 17:17:42 +10:00
Damien Elmes
e051d8ab75 older clients require 'separate' on filtered decks
the deckconf['new']['separate' property is unused, but older code
assumes filtered['separate'] exists, even though it doesn't do anything
with it

https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48240796
2020-04-15 15:02:12 +10:00
Damien Elmes
f5f2782e3b embed sort kind enum to avoid future namespace conflicts 2020-04-14 20:31:10 +10:00
Damien Elmes
351c7b6a82 fix dyn being serialized as bool
If you were running from git in the last ~30 hours, please load
your collection using the latest git, review one card, then force
a full upload to fix compatibility with other clients.
2020-04-10 18:07:59 +10:00
Damien Elmes
b7696e6381 merge the 12-14 upgrade code 2020-04-10 17:46:57 +10:00
Damien Elmes
9b66ecd12d add socks support 2020-04-09 14:28:36 +10:00
Damien Elmes
76ecc9739e update rusqlite 2020-04-09 12:45:51 +10:00
Damien Elmes
0538d9b764 (de)serialize decks in backend 2020-04-09 12:41:59 +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
29d66cb717 skip terminal logging unless LOGTERM defined
seems to be quite slow on Windows
2020-04-07 10:25:47 +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
f4a6a12c6f avoid warning on int sortBackwards from older Anki versions 2020-04-06 17:11:03 +10:00
Damien Elmes
02d0d9a670 add separate json error 2020-04-06 16:29:31 +10:00
Damien Elmes
a9fd2da243 log to the terminal as well 2020-04-06 15:57:13 +10:00
Damien Elmes
913c5b9854 use bytes for deck config proto 2020-04-06 15:39:47 +10:00
Damien Elmes
6471adafcc use bytes for config proto 2020-04-06 15:39:47 +10:00
Damien Elmes
3ef959856f display warning when config load fails 2020-04-06 15:39:47 +10:00
Damien Elmes
d05722aa82 use blobs for config 2020-04-06 15:39:47 +10:00
Damien Elmes
b5022ad354 store config in separate DB table
- mtime is tracked on each key individually, which will allow
merging of config changes when syncing in the future
- added col.(get|set|remove)_config()
- in order to support existing code that was mutating returned
values (eg col.conf["something"]["another"] = 5), the returned list/dict
will be automatically wrapped so that when the value is dropped, it
will save the mutated item back to the DB if it's changed. Code that
is fetching lists/dicts from the config like so:

col.conf["foo"]["bar"] = baz
col.setMod()

will continue to work in most case, but should be gradually updated to:

conf = col.get_config("foo")
conf["bar"] = baz
col.set_config("foo", conf)
2020-04-06 15:39:47 +10:00
Damien Elmes
9bce844df7 fix duplicates search 2020-04-04 17:38:35 +10:00
Damien Elmes
3c7eabc51e add flag to skip downgrade on collection close
Disabled for now; when enabled it will allow faster collection
open and close in the normal case, while continuing to downgrade
when exporting or doing a full sync.

Also, when downgrading is disabled, the journal mode is no longer
changed back to delete.
2020-04-04 17:21:45 +10:00
Damien Elmes
ea2a3d7586 use separate schema version for tag changes
Will prevent issues if user upgrades after an unclean shutdown
2020-04-04 10:14:51 +10:00
Damien Elmes
6c9a6cde2b use case folding when sorting in canonify 2020-04-03 19:34:46 +10:00
Damien Elmes
ac54f85840 update tag handling
- tag list stored in a separate DB table
- non-wildcard searches now do full unicode case folding
(eg tag:masse matches 'Maße')
- wildcard matches do simple unicode case folding
- some functions haven't been updated yet, so ascii folding will
continue to be used in some operations
2020-04-03 19:34:46 +10:00
Damien Elmes
07c414692e preserve mtime/usn when syncing deck config, and add snake_case names 2020-04-03 19:34:46 +10:00
Damien Elmes
83c50488fd use support URL and point to source repo 2020-04-03 08:44:59 +10:00
evandrocoan
30107ab09d Created the GitHub Actions step Upload to PyPi to run only on
tagged releases of anki:
https://anki.tenderapp.com/discussions/ankidesktop/40025-anki-in-python-package-index
2020-04-02 02:57:34 -03:00
Damien Elmes
001226050d fix is:due search 2020-04-02 09:33:05 +10:00
Damien Elmes
ddefffceda return interrupted err when media sync aborted 2020-04-01 21:40:14 +10:00