Commit graph

403 commits

Author SHA1 Message Date
Damien Elmes
d005dcc2bf Merge pull request #587 from BlueGreenMagick/tags
remove unnecessary code
2020-04-27 19:25:42 +10:00
BlueGreenMagick
e070320cfa remove unnecessary code 2020-04-27 10:05:38 +09:00
evandrocoan
e85c48298c Fixed make clean rule not working on Windows 2020-04-26 03:02:02 -03:00
Damien Elmes
c9f18ba3d2 fix deleting deck configs 2020-04-20 13:23:05 +10:00
Damien Elmes
dd20337a85 don't write log files when exporting 2020-04-15 21:45:32 +10:00
Damien Elmes
f5f2782e3b embed sort kind enum to avoid future namespace conflicts 2020-04-14 20:31:10 +10:00
Damien Elmes
826e8e4120 Revert "remove unused decks.count()"
This reverts commit dd790390db.

dd790390db
2020-04-13 19:26:12 +10:00
Damien Elmes
8dafa8bce5 move autoplay() into card 2020-04-13 09:04:30 +10:00
Damien Elmes
6bef493aa5 fix replay audio again, and decouple the code from the reviewer 2020-04-13 08:59:36 +10:00
Damien Elmes
96af559d67 set db mod flag if mtime changed by backend 2020-04-11 15:41:21 +10:00
Damien Elmes
46877dbe4e document ankidev and remove sync changes
https://github.com/ankitects/anki/pull/548
2020-04-11 14:36:05 +10:00
Damien Elmes
dd790390db remove unused decks.count() 2020-04-10 10:25:31 +10:00
Damien Elmes
0538d9b764 (de)serialize decks in backend 2020-04-09 12:41:59 +10:00
Damien Elmes
11bbb906a5 fix errorsAfterMidnight 2020-04-08 10:05:19 +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
f8f00f9d21 Merge pull request #543 from Arthur-Milchior/sort_according_to_path
Sort according to path
2020-04-07 14:44:53 +10:00
Damien Elmes
12e9293f60 avoid unnecessary work in 'make build' 2020-04-07 10:59:14 +10:00
Arthur Milchior
6e36bc5f2e immediate_parent 2020-04-06 23:56:24 +02:00
Arthur Milchior
8290f9ff2a immediate_parent_path 2020-04-06 23:55:17 +02:00
Arthur Milchior
d095b017e4 _basename to basename, since it's not private in use 2020-04-06 23:51:50 +02:00
Arthur Milchior
859178c113 _basename used where possible 2020-04-06 23:51:42 +02:00
Arthur Milchior
e6024d4d3d replace _path by path (because it's not private here) 2020-04-06 23:50:43 +02:00
Arthur Milchior
8962194dcb uses _path where possible 2020-04-06 23:50:37 +02:00
Arthur Milchior
7bef7ef8ec Sort decks according to their paths
Currently it's sorted alphabetically. Because of this, "A::B" appears
between "A9" and "AA" in list of decks.
2020-04-06 22:49:25 +02:00
Arthur Milchior
b94f138989 make _path static 2020-04-06 22:45:30 +02:00
Damien Elmes
9ad6480959 hide deprecation warning triggered by supermemo test 2020-04-06 20:24:17 +10:00
Damien Elmes
26a30d95be hide warning when running tests 2020-04-06 20:24:05 +10:00
Damien Elmes
d777abfa4a emulate named args 2020-04-06 20:09:44 +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
915f741330 use a new file each time when testing graphs 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
Arthur Milchior
c837143d31 Remove useless recursion in DeckManager.rem
For any deck the children of it's children are its children. So
applying rem to children of children is useless and actually slightly
costly for deep subdecks
2020-04-05 11:33:23 +02:00
Damien Elmes
1834b65714 downgrade when writing dummy collection 2020-04-04 18:43:26 +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
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
296ebd9c63 set col mod explicitly in decks.select() 2020-04-03 19:34:46 +10:00
Damien Elmes
96e1eca4bb ensure pending deck/tag/note type changes flushed before searching 2020-04-03 19:34:46 +10:00
Damien Elmes
d7edbedac0 Merge pull request #535 from evandroforks/upload_wheels_to_pypi
Created the GitHub Actions step Upload to PyPi
2020-04-03 08:40:17 +10:00
evandrocoan
b3ed8ebfdb Fixed double python version check for python_requires=">=3.7" 2020-04-02 12:31:12 -03: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
6beb2ff1e3 return the added card id instead of mutating the backend card object 2020-04-02 12:09:46 +10:00
Damien Elmes
7068f97e1f make sure None is returned in no-such-card case 2020-04-02 11:29:40 +10:00
Damien Elmes
cbfc0207ec tolerate string values in deck["conf"] 2020-04-01 19:36:40 +10:00
Damien Elmes
9c09d08152 remove defaultConf 2020-04-01 17:36:46 +10:00
Damien Elmes
284ee0860b allow aborting a media sync while http req in flight
The progress handling code needs a rethink, as we now have two separate
ways to flag that the media sync should abort. In the future, it may
make sense to switch to polling the backend for progress, instead of
passing a callback in.
2020-04-01 09:49:25 +10:00
Damien Elmes
6482af7361 add a temporary cache to bring deck list performance back 2020-03-30 20:27:53 +10:00
Damien Elmes
cffe146397 split deck config into separate SQL table
- on collection load, the schema is upgraded to 12
- on collection close, the changes are reversed so older clients
can continue to open the collection
- in the future, we could potentially skip the reversal except
when exporting/doing a full sync
- the same approach should work for decks, note types and tags in the
future too
- the deck list code needs updating to cache the deck confs for the
life of the call
2020-03-30 20:01:16 +10:00
Damien Elmes
089a68eb43 move deck conf handling to backend 2020-03-30 14:39:46 +10:00