Commit graph

1408 commits

Author SHA1 Message Date
Damien Elmes
7127dca4bd allow repositioning of new cards while suspended
https://forums.ankiweb.net/t/no-longer-can-reposition-a-suspended-card/12241
2021-08-15 15:06:25 +10:00
Damien Elmes
a697d0b537 check both queues when popping answered card
If multiple answers are applied in succession, a newly-due learning card
may be in front of the next main entry.
2021-08-09 18:29:04 +10:00
abdo
f3ce557d5e Fix double quotes being escaped twice in dupe search
maybe_quote() already escapes double quotes.
2021-08-09 05:05:20 +03:00
Damien Elmes
2bf1dca15c fall back on default deck in v3 queue gather as well
Missed in the previous change.

https://forums.ankiweb.net/t/error-when-trying-to-choose-deck-in-new-anki/11829/11
2021-08-09 11:04:37 +10:00
Damien Elmes
13ffd705f2 fallback on default deck in congrats screen
https://forums.ankiweb.net/t/error-when-trying-to-choose-deck-in-new-anki/11829
2021-08-04 12:57:46 +10:00
Damien Elmes
cfb9a9ec9f fix undoing last learning card corner case 2021-08-04 10:29:01 +10:00
Damien Elmes
dd4bd58638 support updating multiple notes in one transaction/undo op 2021-08-02 17:07:26 +10:00
Damien Elmes
e278f3ad1d support updating multiple cards in one transaction/undo op 2021-08-02 16:59:02 +10:00
Damien Elmes
e165e1c40c revert to defaults when schema 11 deck config can not be read
Allows decks with missing/null values like ivlFct to be opened.

https://forums.ankiweb.net/t/i-cant-access-ankiweb/11814
2021-08-02 16:27:48 +10:00
Damien Elmes
86d5d7e020 don't hide learning count on congrats screen when learning is overdue
The v3 scheduler will delay the final card from being shown twice in
a row, but the overdue case was being treated the same as the no-learning
case, leading to the message being hidden.
2021-08-02 15:57:09 +10:00
Damien Elmes
ba2d9fe77e update learning cutoff when counts are zero 2021-08-02 15:03:14 +10:00
Damien Elmes
2e614255b8 fix learning cutoff not updating during review 2021-08-02 15:03:14 +10:00
Damien Elmes
9609cd36de fix v3 not honoring initial ease factor
Closes #1317
2021-07-31 14:57:04 +10:00
RumovZ
a5f9dfbc87 Use existing 'no such field' tr string 2021-07-29 08:30:49 +02:00
RumovZ
4fc3670e1a Allow duplicate templates if {{Card}} is used 2021-07-28 22:32:38 +02:00
RumovZ
db7916fa11 Skip new notetype checks when importing apkg 2021-07-28 21:46:51 +02:00
RumovZ
fcd8ef9763 Find template errors hidden by conditionals 2021-07-28 12:13:14 +02:00
RumovZ
4da4ca5c57 Check for invalid conditionals on templates 2021-07-28 11:53:31 +02:00
Damien Elmes
9a2d8cc5f0 fix reqwest build on Linux again 2021-07-24 10:18:09 +10:00
Damien Elmes
b90388bee2 use separate integration test for links
If we run into issues with unreliable network connections in the future,
we'll be able to mark the test as flaky so Bazel can retry it multiple
times.
2021-07-24 10:12:25 +10:00
Damien Elmes
cfdbdb4a49 Merge pull request #1308 from RumovZ/check-help
Build and check help links on the backend
2021-07-24 09:37:23 +10:00
RumovZ
c3d2bc2d9f Fix linkcheck result message 2021-07-23 19:40:51 +02:00
Damien Elmes
032b2b272b disable link check outside CI 2021-07-23 20:22:32 +10:00
Damien Elmes
d25785f7fb be explicit about .html suffix 2021-07-23 20:22:32 +10:00
Damien Elmes
c31f56e768 fix clippy lints 2021-07-23 20:22:32 +10:00
Damien Elmes
e9669c165a add linkcheck to Bazel 2021-07-23 20:22:32 +10:00
RumovZ
a24b54af21 Add check to ensure parsed URL equals link 2021-07-23 11:44:19 +02:00
RumovZ
03f11dcb32 Improve error message for unknown fragment 2021-07-23 10:32:29 +02:00
RumovZ
72a9507c18 Remove native HelpPage enum
Also remove oneof from pb enum and handle strs in Python.
2021-07-22 16:32:49 +02:00
RumovZ
d8fb6fa8c7 Add links.proto and backend module 2021-07-22 10:05:38 +02:00
RumovZ
059774cc9b Add links.rs for checking and building links 2021-07-22 10:03:03 +02:00
Damien Elmes
39b2f5d82f handle notes with missing cards in browser
https://forums.ankiweb.net/t/2-1-45-release-candidate/11362/30
2021-07-22 14:58:57 +10:00
Damien Elmes
ef4289b4be strip invalid Unicode chars in media check 2021-07-17 18:30:19 +10:00
Damien Elmes
83a88d0779 fix comment + copy/paste error 2021-07-17 09:02:14 +10:00
Aleksa Sarai
5d7847515c scheduler: use deck config's initial ease in set_due_date
Previously we would just use 250% ease for any new card that had no
pre-configured ease, but this will result in decks that have
non-standard ease values to have "set due date" cards in them that don't
match. In order to make this somewhat more efficient, we cache
deckid->ease lookups during this operation.

Ref: <https://forums.ankiweb.net/t/set-due-date-doesnt-obey-default-ease-factor/9184>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-07-16 12:33:15 +10:00
Damien Elmes
eb4e18a45f Merge pull request #1293 from RumovZ/find-and-replace
Find & Replace
2021-07-16 10:47:16 +10:00
Damien Elmes
1e2ebd1c29 move from Python's URI escaping to IRI escaping in Rust
Should make non-Latin text readable in the HTML editor, without the
breakages reverted in the previous change.
2021-07-16 10:38:00 +10:00
RumovZ
4b1218184d Rework Find & Replace dialog:
- Add option to affect whole collection
- Allow to open without selection
- Add parameter for presetting field
2021-07-13 16:33:45 +02:00
RumovZ
a68b07d9ee Fix find & replace for notes without 'field_name'
Distinguish between no 'field_name' passed and 'field_name' not on note.
2021-07-13 16:21:13 +02:00
Damien Elmes
1189e763df minor tidyup in protobuf build script 2021-07-12 16:15:38 +10:00
Damien Elmes
08ddd9cc90 drop the cloze-in-basic check for now
Unfortunately a popular note taking tool has been misusing cloze
markers in its deck exports. We may want to add this back in the
future, but we'll probably want to start by warning users, to give
people time to adjust.
2021-07-11 20:31:02 +10:00
Damien Elmes
0eab59e522 configs.proto plural workaround no longer necessary 2021-07-11 19:35:18 +10:00
Damien Elmes
2238cdaa43 rename Config in protobuf to avoid conflict with module name
+ use the enum directly, instead of wrapping it in an object

Python code retains the old "Config" name.
2021-07-11 19:27:08 +10:00
Damien Elmes
e3b53fc078 split out remaining tags, stats, media and rendering 2021-07-10 23:16:18 +10:00
Damien Elmes
673955de5b split out sync, search, scheduler & config 2021-07-10 21:33:12 +10:00
Damien Elmes
1fb86d499d split out decks, deckconfig, notes, notetypes 2021-07-10 20:44:22 +10:00
Damien Elmes
c43674762e split out cards and collection 2021-07-10 19:52:31 +10:00
Damien Elmes
5255409093 refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:

- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.

The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.

The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.

Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 19:17:05 +10:00
Damien Elmes
14263c7a79 move protobuf into separate folder in preparation for multiple files 2021-07-09 21:02:40 +10:00
RumovZ
e763745e05 Add pylib/browser.py for literal config keys
Also, remove config bools for sort order.
2021-07-05 12:44:48 +02:00