Commit Graph

1199 Commits

Author SHA1 Message Date
Damien Elmes
de668441b5 clear_unused_tags and browser redraw improvements
- clear_unused_tags() is now undoable, and returns the number of removed
notes
- add a new mw.query_op() helper for immutable queries
- decouple "freeze/unfreeze ui state" hooks from the "interface update
required" hook, so that the former is fired even on error, and can be
made re-entrant
- use a 'block_updates' flag in Python, instead of setUpdatesEnabled(),
as the latter has the side-effect of preventing child windows like
tooltips from appearing, and forces a full redrawn when updates are
enabled again. The new behaviour leads to the card list blanking out
when a long-running op is running, but in the future if we cache the
cell values we can just display them from the cache instead.
- we were indiscriminately saving the note with saveNow(), due to the
call to saveTags(). Changed so that it only saves when the tags field
is focused.
- drain the "on_done" queue on main before launching a new background
task, to lower the chances of something in on_done making a small query
to the DB and hanging until a long op finishes
- the duplicate check in the editor was executed after the webview loads,
leading to it hanging until the sidebar finishes loading. Run it at
set_note() time instead, so that the editor loads first.
- don't throw an error when a long-running op started with with_progress()
finishes after the window it was launched from has closed
- don't throw an error when the browser is closed before the sidebar
has finished loading
2021-03-19 19:45:21 +10:00
Damien Elmes
6b0fe4b381 undoable ops now return changes directly; add new *_ops.py files
- Introduced a new transact() method that wraps the return value
in a separate struct that describes the changes that were made.
- Changes are now gathered from the undo log, so we don't need to
guess at what was changed - eg if update_note() is called with identical
note contents, no changes are returned. Card changes will only be set
if cards were actually generated by the update_note() call, and tag
will only be set if a new tag was added.
- mw.perform_op() has been updated to expect the op to return the changes,
or a structure with the changes in it, and it will use them to fire the
change hook, instead of fetching the changes from undo_status(), so there
is no risk of race conditions.
- the various calls to mw.perform_op() have been split into separate
files like card_ops.py. Aside from making the code cleaner, this works
around a rather annoying issue with mypy. Because we run it with
no_strict_optional, mypy is happy to accept an operation that returns None,
despite the type signature saying it requires changes to be returned.
Turning no_strict_optional on for the whole codebase is not practical
at the moment, but we can enable it for individual files.

Still todo:
- The cursor keeps moving back to the start of a field when typing -
we need to ignore the refresh hook when we are the initiator.
- The busy cursor icon should probably be delayed a few hundreds ms.
- Still need to think about a nicer way of handling saveNow()
- op_made_changes(), op_affects_study_queue() might be better embedded
as properties in the object instead
2021-03-19 19:45:21 +10:00
Damien Elmes
1e849316be more reset refactoring
'card modified' covers the common case where we need to rebuild the
study queue, but is also set when changing the card flags. We want to
avoid a queue rebuild in that case, as it causes UI flicker, and may
result in a different card being shown. Note marking doesn't trigger
a queue build, but still causes flicker, and may return the user back
to the front side when they were looking at the answer.

I still think entity-based change tracking is the simplest in the
common case, but to solve the above, I've introduced an enum describing
the last operation that was taken. This currently is not trying to list
out all possible operations, and just describes the ones we want to
special-case.

Other changes:

- Fire the old 'state_did_reset' hook after an operation is performed,
so legacy code can refresh itself after an operation is performed.
- Fire the new `operation_did_execute` hook when mw.reset() is called,
so that as the UI is updated to the use the new hook, it will still
be able to refresh after legacy code calls mw.reset()
- Update the deck browser, overview and review screens to listen to
the new hook, instead of relying on the main window to call moveToState()
- Add a 'set flag' backend action, so we can distinguish it from a
normal card update.
- Drop the separate added/modified entries in the change list in
favour of a single entry per entity.
- Add typing to mw.state
- Tweak perform_op()
- Convert a few more actions to use perform_op()
2021-03-19 19:45:21 +10:00
Damien Elmes
112cbe8b59 experiment with finer-scoped reset in perform_op()
Basic proof of concept, where the 'delete note' operation in the
reviewer has been updated to use mw.perform_op(). Instead of manually
calling .reset() afterwards, a summary of the changes is returned as
part of the undo status query, and various parts of the GUI can listen
to gui_hooks.operation_did_execute and decide whether they want to
redraw based on the scope of the changes. This should allow the sidebar
to selectively redraw just the tags area in the future for example.

Currently we're just listing out all possible areas that might be changed;
in the future we could theoretically inspect the specific changes in the
undo log to provide a more accurate report (avoiding refreshing the tags
list when no tags were added for example).

You can test it out by opening the browse screen while studying, and
then deleting the current card - the browser should update to show (deleted)
on the cards due the earlier change.

If going ahead with this, aside from updating all the screens that currently
listen for resets, some thought will be required on how we can integrate
it with legacy code that expects to called when resets are made, and expects
to call .reset() when it makes changes.

Thoughts?
2021-03-19 19:45:21 +10:00
Damien Elmes
8fc43956c2 move collection mtime bump into backend
Fixes the following issue:
- some code directly modifies the database, causing modified_in_python
to be set to true
- an undoable operation is run, which calls autosave() at the end
- autosave() notices there's an undoable operation, and commits immediately
- because modified_in_python was true, col.mtime was bumped in Python
- that invalidated the undo queue, preventing the operation from being
undone
2021-03-19 19:45:21 +10:00
Damien Elmes
a90a6ab3cd normalize first field before comparing with local DB
https://forums.ankiweb.net/t/python-checksum-rust-checksum/8195/8
2021-03-17 22:22:58 +10:00
Damien Elmes
7472181aeb Revert "ensure fields normalized before checksumming"
This reverts commit f4bd867b3b54b172125d2f2021c8c6a6e69c4c4d.
2021-03-17 22:21:13 +10:00
Damien Elmes
f8b5210df9 fix schema not being modified
https://forums.ankiweb.net/t/python-checksum-rust-checksum/8195/8
2021-03-17 22:18:31 +10:00
Damien Elmes
1ab085dfab ensure fields normalized before checksumming
https://forums.ankiweb.net/t/python-checksum-rust-checksum/8195
2021-03-13 10:23:32 +10:00
Damien Elmes
44dc3f494c avoid hanging UI when undoing in browse screen 2021-03-12 18:54:08 +10:00
Damien Elmes
57a05a2ae3 undo in background, and show progress window 2021-03-12 17:54:56 +10:00
Damien Elmes
c1316bb65f 'set due date' now undoable 2021-03-12 14:50:31 +10:00
Damien Elmes
ec8adf7371 move old scheduler files into scheduler/
Includes a hack that should allow existing imports to continue to work;
if this breaks things for you, please let me know.
2021-03-12 14:43:45 +10:00
Damien Elmes
ad973bb701 split out common scheduler code into base.py, use scheduler/ dir
Also move the legacy aliases into a separate file
2021-03-12 14:07:52 +10:00
RumovZ
f4c2fe6485 Merge branch 'master' into sidebar-tools 2021-03-11 12:08:32 +01:00
RumovZ
dad92e1e22 Annotate decks.rem as deprecated 2021-03-11 11:26:35 +01:00
Damien Elmes
984e2c2666 add a separate 'rename deck' method 2021-03-11 19:24:54 +10:00
RumovZ
f1dd010489 Remove deck remove prompt but show card count 2021-03-11 09:52:11 +01:00
Damien Elmes
4bd120cc4b split out remaining rpc methods
@david-allison-1 note this also changes the method index to start at
0 instead of 1
2021-03-11 17:04:32 +10:00
Damien Elmes
cd14987812 split out tags, deck config and card rendering 2021-03-11 16:05:06 +10:00
Damien Elmes
5df684fa6b rework backend codegen to support multiple services; split out sched
Rust requires all methods of impl Trait to be in a single file, which
means we had a giant backend/mod.rs covering all exposed methods. By
using separate service definitions for the separate areas, and updating
the code generation, we can split it into more manageable chunks -
this commit starts with the scheduling code.

In the long run, we'll probably want to split up the protobuf file into
multiple files as well.

Also dropped want_release_gil() from rsbridge, and the associated method
enum. While it allows us to skip the thread save/restore and mutex unlock/
lock, it looks to only be buying about 2.5% extra performance in the
best case (tested with timeit+format_timespan), and the majority of
the backend methods deal with I/O, and thus were already releasing the
GIL.
2021-03-11 14:51:29 +10:00
RumovZ
0c2ac4ba04 Merge branch 'master' into sidebar-tools 2021-03-10 10:34:36 +01:00
Damien Elmes
ce243c2cae Simplify note adding and the deck/notetype choosers
The existing code was really difficult to reason about:

- The default notetype depended on the selected deck, and vice versa,
and this logic was buried in the deck and notetype choosing screens,
and models.py.
- Changes to the notetype were not passed back directly, but were fired
via a hook, which changed any screen in the app that had a notetype
selector.

It also wasn't great for performance, as the most recent deck and tags
were embedded in the notetype, which can be expensive to save and sync
for large notetypes.

To address these points:

- The current deck for a notetype, and notetype for a deck, are now
stored in separate config variables, instead of directly in the deck
or notetype. These are cheap to read and write, and we'll be able to
sync them individually in the future once config syncing is updated in
the future. I seem to recall some users not wanting the tag saving
behaviour, so I've dropped that for now, but if people end up missing
it, it would be simple to add as an extra auxiliary config variable.
- The logic for getting the starting deck and notetype has been moved
into the backend. It should be the same as the older Python code, with
one exception: when "change deck depending on notetype" is enabled in
the preferences, it will start with the current notetype ("curModel"),
instead of first trying to get a deck-specific notetype.
- ModelChooser has been duplicated into notetypechooser.py, and it
has been updated to solely be concerned with keeping track of a selected
notetype - it no longer alters global state.
2021-03-10 11:53:27 +10:00
Damien Elmes
c4f6ec99f7 Remove collection repr
I find the extra info it adds to tracebacks in pytest just makes them
harder to read.
2021-03-10 11:53:27 +10:00
Damien Elmes
0207f6c0ab update Rust deps 2021-03-10 11:53:27 +10:00
Damien Elmes
3d0ddc8539 make flag changes in the reviewer undoable
This splits update_card() into separate undoable/non-undoable ops
like the change to notes in b4396b94abdeba3347d30025c5c0240d991006c9

It means that actions get a blanket 'Update Card' description - in the
future we'll probably want to either add specific actions to the backend,
or allow an enum or string to be passed in to describe the op.

Other changes:
- card.flush() can no longer be used to add new cards. Card creation
is only supposed to be done in response to changes in a note's fields,
and this functionality was only exposed because the card generation
hadn't been migrated to the backend at that point. As far as I'm aware,
only Arthur's "copy notes" add-on used this functionality, and that should
be an easy fix - when the new note is added, the associated cards will
be generated, and they can then be retrieved with note.cards()
- tidy ups/PEP8
2021-03-10 11:53:27 +10:00
Damien Elmes
f1a1b0891e make mark toggling undoable
- note.flush() behaves like before, as otherwise actions or add-ons
that perform bulk flushing would end up creating an undo entry for
each note
- added col.update_note() to opt in to the new behaviour
- tidy up the names of some related routines
2021-03-10 11:53:27 +10:00
Damien Elmes
bec77fd420 undo support for bulk tag add/remove 2021-03-10 11:47:53 +10:00
Damien Elmes
49a1970399 note deletion undo; refactoring
- transact() now automatically clears card queues unless an op
opts-out (and currently only AnswerCard does). This means there's no
risk of forgetting to clear the queues in an operation, or when undoing/
redoing
- CollectionOp->UndoableOp
- clear queues when redoing "answer card", instead of clearing redo
when clearing queues
2021-03-10 11:47:53 +10:00
Damien Elmes
9445e2ee22 drop some unused properties 2021-03-10 11:47:53 +10:00
Damien Elmes
605ad1c9ee remove unnecessary setMod() calls 2021-03-10 11:47:53 +10:00
Damien Elmes
57d7e3e2ab commit immediately when there's no active checkpoint
Reviews and operations on the backend that support undoing can now be
committed immediately, so they will not be lost in the event of a crash.

This required tweaks to a few places:

- don't set collection mtime on save() unless changes were made in
Python, as otherwise we end up accidentally clearing the backend undo
queue
- autosave() is now run on every reset()
- garbage collection now runs in a timer, instead of relying on
autosave() to be run periodically
2021-03-10 11:47:53 +10:00
Damien Elmes
40aff4447a undo support for note adding 2021-03-10 11:47:53 +10:00
Damien Elmes
b466f0ce90 rework undo
- use dataclasses for the review/checkpoint undo cases, instead of the
nasty ad-hoc list structure
- expose backend review undo to Python, and hook it into GUI
- redo is not currently exposed on the GUI, and the backend can only
cope with reviews done by the new scheduler at the moment
- the initial undo prototype code was bumping mtime/usn on undo, but
that was not ideal, as it was breaking the queue handling which expected
the mtime to match. The original rationale for bumping mtime/usn was
to avoid problems with syncing, but various operations like removing
a revlog can't be synced anyway - so we just need to ensure we clear the
undo queue prior to syncing
2021-03-10 11:47:53 +10:00
Damien Elmes
c9eeb91e0a initial work on undoing reviews+burying siblings
- fetch sfld and csum when fetching notes, to make it cheaper
to write them back out unmodified
- make `fields` private, and access it via accessors, so we can
still catch when fields have been mutated without calling
prepare_for_update()
- fix python importing code passing a string in as the checksum
2021-03-10 11:47:53 +10:00
Damien Elmes
b81e2c0265 Ensure we purge caches when rolling back
Fixes #1056
2021-03-08 10:39:18 +10:00
Damien Elmes
5f9792392a don't cap child counts to parents when reviewing in v2
https://forums.ankiweb.net/t/anki-2-1-41-beta/7305/59

When originally implemented in 21023ed3e5,
a given deck's limit was bound by its parents. This lead to a deck list
that seemed more logical in the parent limit < child limit case, as
child counts couldn't exceed a parent's, but it obscured the fact that
child decks could still be clicked on to show cards. And in the parent
limit > child limit case, the count shown for the child on the deck list
did not reflect how many cards were actually available and would be
delivered.

This change updates the reviewer to ignore parent limits when getting
review counts for the deck, which makes the behaviour consistent with
the deck list, which was recently changed to ignore parent limits.

Neither solution is ideal - this was a tradeoff v2 made in order to keep
fetching of review cards from multiple decks reasonably performant. The
experimental scheduling work moves back to respecting limits on
individual children, so this should hopefully improve in the future.

Also removed _revForDeck(), which was unused.
2021-03-02 10:23:06 +10:00
Damien Elmes
de7baa80bd switch to 4 buttons when previewing in test scheduler
- Currently we just use 1.5x and 2x the normal preview delay; we could
change this in the future.
- Don't try to capture the current state; just use a flag to denote
exit status.
- Show (end) when exiting
2021-03-01 23:47:00 +10:00
Damien Elmes
4387e3ed86 fix reps updating in v2, but do it in answerCard instead of getCard 2021-03-01 21:48:02 +10:00
Damien Elmes
8f0c8b6f8a use different approach to running tests twice
The symlink approach was breaking on Windows
2021-03-01 12:47:39 +10:00
Damien Elmes
2c6b6734b5 experimental queue building
Still a work in progress, and hidden behind a feature flag.
2021-03-01 12:18:21 +10:00
RumovZ
88c69665f3 Add support for multi deck deletion in python 2021-02-26 19:52:34 +01:00
RumovZ
92cbf168f6 Catch DeckIsFilteredError directly on frontend 2021-02-26 11:32:40 +01:00
RumovZ
ef925a88d6 Add filtered deck error localisation on backend 2021-02-26 11:32:26 +01:00
Damien Elmes
f165576992 implement leech handling
Also change the default for new users to "tag only"
2021-02-23 17:35:20 +10:00
Damien Elmes
69448365c4 move test code behind env var 2021-02-22 21:32:18 +10:00
Damien Elmes
97300a16bf implement fuzzing
Notes:

- The fuzz seed is now derived from the card id and # of reps, so
if a card is undone and done again, the same fuzz will be used.
- The intervals shown on the answer buttons now include the fuzz, instead
of hiding it from the user. This will prevent questions about due dates
being different to what was shown on the buttons, but will create
questions about due dates being different for cards with the same
interval, and some people may find it distracting for learning cards.
The new approach is easier to reason about, but time will tell
whether it's a net gain or not.
- The env var we were using to shift the clock away from rollover for
unit tests has been repurposed to also disable fuzzing, which simplifies
the tests.
- Cards in filtered decks without scheduling now have the preview delay
fuzzed.
- Sub-day learning cards are mostly fuzzed like before, but will apply
the up-to-5-minutes of fuzz regardless of the time of day.
- The answer buttons now round minute values, as the fuzz on short
intervals is distracting.
2021-02-22 21:31:53 +10:00
Damien Elmes
08c5fe474a make checkRevIvl() assert so pytest can print values; fix missed check 2021-02-22 21:31:53 +10:00
Damien Elmes
f82cf0cd4b drop some unused code 2021-02-22 21:31:53 +10:00
Damien Elmes
3af5221895 plug new answering code in
This is not the way the code is intended to be used, but making it
conform to the existing API allows us to exercise the existing unit
tests and provides partial backwards compatibility.

- Leech handling is currently broken
- Fix answered_at in wrong units, and not being used
2021-02-22 21:31:53 +10:00
Damien Elmes
f811beae5e remove burySiblings()'s dependency on newConf()/revConf() 2021-02-22 21:31:53 +10:00
Damien Elmes
7dc05253c1 fix a few more instances where v2 tests were referencing 'left today' 2021-02-22 21:31:53 +10:00
Damien Elmes
72389595fa tidy up top of file 2021-02-22 21:31:53 +10:00
Damien Elmes
63df7ee7a9 move re-queuing out of _answerCard() 2021-02-22 21:31:53 +10:00
Damien Elmes
a112a4403a duplicate schedv2.py in scheduler.py 2021-02-22 11:40:19 +10:00
Damien Elmes
c659898ee1 separate queue building and card answering 2021-02-22 11:33:28 +10:00
Damien Elmes
b8ad694006 move more routines down 2021-02-22 11:14:41 +10:00
Damien Elmes
4c5d4befbf move routines not related to building/answering to bottom of file 2021-02-22 11:07:56 +10:00
Damien Elmes
e7bcc22d6f move legacy aliases to bottom of schedv2.py 2021-02-22 10:57:08 +10:00
Damien Elmes
f50cd43e75 fix incorrect nested review counts in v2 scheduler
https://forums.ankiweb.net/t/problem-with-anki-subdecks/7689
2021-02-21 22:48:14 +10:00
Damien Elmes
53d9433d94 Revert "use v2 scheduler+new timezone handling by default for new users"
This reverts commit 8372931b9b.

I fear this will be too disruptive - let's give AnkiDroid a bit more
time to catch up. Reverting this will mean new users are presented with
an upgrade notice on first startup, which looks a bit silly, but it's
probably the lesser of two evils.
2021-02-21 19:03:46 +10:00
Damien Elmes
8372931b9b use v2 scheduler+new timezone handling by default for new users
- In corner cases, enabling the new timezone handling later can cause
reviews to shift forward or back a day, so it's best to have it on
by default.
- https://github.com/ankidroid/Anki-Android/issues/5805 has not landed
in a stable release yet, but will hopefully not be too far off by the
time 2.1.41 is released.
- Existing users will be unaffected, as the upgrade prompt in the previous
commit asks them if they use AnkiDroid.
- Users starting on AnkiDroid will be unaffected, as their collections
will still be on V1.
- The error message AnkiWeb gives when syncing an older AnkiDroid
with the new timezone enabled has been updated to direct users to the
preferences screen.
2021-02-21 17:18:08 +10:00
Damien Elmes
5ae66af5d2 rework v2 scheduler upgrade; drop downgrade
- Rework V2 upgrade so that it no longer resets cards in learning,
or empties filtered decks.
- V1 users will receive a message at the top of the deck list
encouraging them to upgrade, and they can upgrade directly from that
screen.
- The setting in the preferences screen has been removed, so users
will need to use an older Anki version if they wish to switch back to
V1.
- Prevent V2 exports with scheduling from being importable into a V1
collection - the code was previously allowing this when it shouldn't
have been.
- New collections still default to v1 at the moment.

Also add helper to get map of decks and deck configs, as there were
a few places in the codebase where that was required.
2021-02-21 15:50:41 +10:00
Damien Elmes
54fa322f3d add some flush() calls and fix a card type in test_schedv2
Will help test when code is moved to backend
2021-02-20 14:00:26 +10:00
Damien Elmes
713bf254c8 stop checking "steps left today" in test_schedv2 2021-02-20 13:59:07 +10:00
Damien Elmes
2a7945f4be fix __repr__ in collection 2021-02-20 13:57:53 +10:00
Damien Elmes
b13d28cc5b tidy up doc string 2021-02-19 10:04:57 +10:00
abdo
010ebef12e Add docstrings to find_cards() and find_notes() 2021-02-17 17:30:38 +03:00
Henrik Giesel
87febe489e Allow for passing in custom note type and template 2021-02-12 02:12:03 +01:00
Henrik Giesel
270cef63f4 Allow for passing in custom note types for rendering ephemeral cards 2021-02-12 01:53:03 +01:00
Damien Elmes
35840221bb tweak search wording and tidy up API
- SearchTerm -> SearchNode
- Operator -> Joiner; share between messages
- build_search_string() supports specifying AND/OR as a convenience
- group_searches() makes it easier to negate
2021-02-11 19:57:19 +10:00
Damien Elmes
59ccfe5918 more search bikeshedding
While implementing the overdue search, I realised it would be nice to
be able to construct a search string with OR and NOT searches without
having to construct each part individually with build_search_string().

Changes:

- Extends SearchTerm to support a text search, which will be parsed
by the backend. This allows us to do things like wrap text in a group
or NOT node.
- Because SearchTerm->Node conversion can now fail with a parsing error,
it's switched over to TryFrom
- Switch concatenate_searches and replace_search_term to use SearchTerms,
so that they too don't require separate string building steps.
- Remove the unused normalize_search()
- Remove negate_search, as this is now an operation on a Node, and
users can wrap their search in SearchTerm(negated=...)
- Remove the match_any and negate args from build_search_string

Having done all this work, I've just realised that perhaps the original
JSON idea was more feasible than I first thought - if we wrote it out
to a string and re-parsed it, we would be able to leverage the existing
checks that occur at parsing stage.
2021-02-11 17:11:17 +10:00
Damien Elmes
5ab115c145 convert some pylib strings to f-strings with flynt
excluded some changes where readability got noticeably worse
2021-02-11 09:51:09 +10:00
Damien Elmes
bb29ce88f3 minor code cleanups with pyupgrade
- pyupgrade --py38-plus --keep-runtime-typing --keep-percent-format
- third-party mpv and winpaths excluded
2021-02-11 09:43:40 +10:00
Damien Elmes
9ce4b21935 add markdown flag for deck description
Needed so we can display consistently, and gradually transition over
2021-02-09 18:47:19 +10:00
Damien Elmes
a8ddb65e1c add ability to force interval reset
- use trailing ! to force a reset
- use - instead of ..
- tweak i18n messages and error handling
2021-02-08 22:33:27 +10:00
Damien Elmes
b9635ce936 nest NoteWithEmptyCards 2021-02-08 19:11:16 +10:00
Damien Elmes
c23b01978d nest progress messages and remove Python wrapper class
The progress messages are only really intended to be consumed by Anki.
If consumption by add-ons was expected, we'd be better off keeping the
wrapper, as the API for oneofs in Python is quite awkward to use.
2021-02-08 16:40:27 +10:00
Damien Elmes
f434cff36f remember last input for 'set due'; add string config; nest config types 2021-02-08 14:10:05 +10:00
Damien Elmes
b56580a8c0 fix rsbackend compat issues 2021-02-08 09:51:51 +10:00
Damien Elmes
704b5e581a Rework reschedule tool
The old rescheduling dialog's two options have been split into two
separate menu items, "Forget", and "Set Due Date"

For cards that are not review cards, "Set Due Date" behaves like the
old reschedule option, changing the cards into a review card, and
and setting both the interval and due date to the provided number of
days.

When "Set Due Date" is applied to a review card, it no longer resets
the card's interval. Instead, it looks at how much the provided number
of days will change the original interval, and adjusts the interval by
that amount, so that cards that are answered earlier receive a smaller
next interval, and cards that are answered after a longer delay receive
a bonus.

For example, imagine a card was answered on day 5, and given an interval
of 10 days, so it has a due date of day 15.

- if on day 10 the due date is changed to day 12 (today+2), the card
is being scheduled 3 days earlier than it was supposed to be, so the
interval will be adjusted to 7 days.
- and if on day 10 the due date is changed to day 20, the interval will
be changed from 10 days to 15 days.

There is no separate option to reset the interval of a review card, but
it can be accomplished by forgetting the card(s), and then setting the
desired due date.

Other notes:

- Added the action to the review screen as well.
- Set the shortcut to Ctrl+Shift+D, and changed the existing Delete
Tags shortcut to Ctrl+Alt+Shift+A.
2021-02-07 21:57:51 +10:00
Damien Elmes
dfe3c457e5 use top level defs for protobuf enum cases
While mypy can understand nested references like ConfigBool.Key.COLLAPSE_RECENT,
PyCharm doesn't understand the metaclass syntax, and shows the definitions
as invalid.
2021-02-05 19:26:13 +10:00
Damien Elmes
b8d67cdad5 move remaining Filter button items into sidebar
- Closes #976
- Added helper to apply arbitrary colour to an icon.
- Fix #979 - low res icons in night mode.
- The icons and colours are not perfect - please feel free to send
through a PR if you can improve them.
- Convert colors dictionary into module consts, so we can
use code completion.
- Added "Edited Today" and "Due Tomorrow"
- Rename camelCase attribute to snake_case and tweak the wording
of some enum constants. We've already broken compatibility with the
major sidebar add-ons, so we may as well make these changes while we
can.
- Removed Filter button. Currently there is no exposed way to toggle
the Sidebar off - wonder if we still need it?
2021-02-05 18:58:22 +10:00
Damien Elmes
790562cd08 update Rust deps 2021-02-03 20:29:48 +10:00
Damien Elmes
168963460f update to latest mypy_protobuf
The handling of enum types has improved - we no longer need to import
separate types at typechecking time.
2021-02-03 13:31:52 +10:00
Henrik Giesel
22a5db8ace Remove unused imports 2021-02-02 17:13:35 +01:00
Henrik Giesel
2483ef4517 Use new note.ephemeral_card method in clayout 2021-02-02 16:47:25 +01:00
Henrik Giesel
4d119cada2 Add ephemeral card method 2021-02-02 16:38:21 +01:00
Damien Elmes
a50601ed46 add tag drag & drop support 2021-02-02 20:14:04 +10:00
Damien Elmes
dd54c10e71
Merge pull request #968 from abdnh/sidebar-expand-matches
Expand sidebar match trees one level
2021-02-02 19:03:04 +10:00
Damien Elmes
467064f873 collapsed->expanded in other tag uses for consistency 2021-02-02 18:52:57 +10:00
Damien Elmes
8e0f69b71c return tags as a string list directly; we don't need usn or collapse state 2021-02-02 18:52:57 +10:00
Damien Elmes
7fc32db0c9 fix: slowdowns after import; hard to read popup
QTextEdit() will pin the CPU at 100% for seconds to minutes when
fed a large string to display - work around it by switching to
QPlainTextEdit().

Also strip HTML before showing the user - easier to read, and less
text to display. And turn off word wrap, as it makes it easier to skim,
and further reduces the work the widget needs to do.

https://forums.ankiweb.net/t/big-issue-where-anki-gets-slow-when-you-import-this-deck/7050
2021-02-02 15:49:47 +10:00
Damien Elmes
e7483edee7 update mypy and other Python deps
latest mypy_protobuf can no longer be run directly, so we need
to run a wrapper instead
2021-02-01 15:50:04 +10:00
Damien Elmes
25a1a2c89c always quote types in generated hooks 2021-02-01 08:36:33 +10:00
Damien Elmes
1741ce1ed8 add more typing, and enable checks for missing types for most of pylib 2021-01-31 21:38:36 +10:00
Damien Elmes
bb92dde2d7 warn add-ons importing json from anki.utils; use stdout not stderr 2021-01-31 21:05:46 +10:00
Damien Elmes
7fda601aef add some typehints, and remove some unused code 2021-01-31 20:56:21 +10:00
Damien Elmes
5d810dd799 make backend instance on col private 2021-01-31 18:56:16 +10:00
Damien Elmes
6c483bb577 add public wrappers for remaining backend functions 2021-01-31 18:56:16 +10:00
Damien Elmes
c7f92f0737 fix _backend files not getting format checked 2021-01-31 18:56:16 +10:00
Damien Elmes
ea31e8ca3e move the remaining exports from _backend 2021-01-31 18:56:16 +10:00
Damien Elmes
260a270eb0 embed BuiltinSortKind 2021-01-31 18:56:16 +10:00
Damien Elmes
5974163343 embed kind enum in StockNoteType and remove prefix 2021-01-31 18:56:16 +10:00
Damien Elmes
248e067da7 add back basic rsbackend.py for compatibility 2021-01-31 18:55:45 +10:00
Damien Elmes
9815d96461 remove template_legacy.py 2021-01-31 18:55:45 +10:00
Damien Elmes
67cb147493 move rsbridge into _backend 2021-01-31 18:55:45 +10:00
Damien Elmes
9d853bbb03 start work on more clearly defining backend/protobuf boundaries
- anki._backend stores the protobuf files and rsbackend.py code
- pylib modules import protobuf messages directly from the
_pb2 files, and explicitly export any will be returned or consumed
by public pylib functions, so that calling code can import from pylib
- the "rsbackend" no longer imports and re-exports protobuf messages
- pylib can just consume them directly.
- move errors to errors.py

Still todo:

- rsbridge
- finishing the work on rsbackend, and check what we need to add
back to the original file location to avoid breaking add-ons
2021-01-31 18:55:45 +10:00
RumovZ
cd9767be80 Remove unused BackendNoteTypeID 2021-01-31 08:57:10 +01:00
Damien Elmes
cb805cf355 Merge branch 'more-backend-search' into main 2021-01-31 14:21:51 +10:00
Damien Elmes
8410330f94 move drag/drop deck logic to backend 2021-01-31 13:46:31 +10:00
RumovZ
4745b55d27 Revert addition of pb.NoteIDs 2021-01-30 12:59:18 +01:00
RumovZ
80a4a85510 Remove redundant docstring 2021-01-30 10:37:46 +01:00
Damien Elmes
cb6b88da0f simplify nid/nids searches, and ditch helper function
- IdList could be re-used for a cids: search in the future if required.
- Embedding the message means it's easy to access from Python as
an attribute of SearchTerm.
2021-01-30 11:37:00 +10:00
Damien Elmes
1adc9952f4 simplify Dupe message and ditch helper function
Calling code doesn't need to know about the existence of such helpers;
it can just rely on code completion to discover the required arguments.
2021-01-30 11:10:26 +10:00
Damien Elmes
5e6dd54c8e export SearchTerm from collection.py, and avoid exporting embedded items 2021-01-30 11:01:11 +10:00
Damien Elmes
73b897c754 rename FilterToSearchIn in backend to match frontend 2021-01-30 10:54:21 +10:00
RumovZ
c299e271e8 Refactor search_string() and FilterToSearchIn
See #955.
2021-01-29 18:27:33 +01:00
Damien Elmes
5ff7944a26 add getter/setter for boolean config values 2021-01-29 21:03:19 +10:00
RumovZ
349bd9d681 Use proper docstrings 2021-01-29 09:40:21 +01:00
RumovZ
1fb6024454 Rename filters added_in etc. to added_in_days 2021-01-29 09:38:13 +01:00
Damien Elmes
7693879e3c remove unused set_all_config; expose .all_config(). 2021-01-29 16:30:42 +10:00
RumovZ
423d7e5098 Use backend filter for findDupes and handle excep. 2021-01-28 19:49:16 +01:00
RumovZ
d33442f901 Add backend filter for field name 2021-01-28 19:48:01 +01:00
RumovZ
407358ab68 Use backend nid filter in browser 2021-01-28 16:21:56 +01:00
RumovZ
51e1e82a9a Add helper functions for search strings in col 2021-01-28 11:13:57 +01:00
Maksim Abramchuk
0eb653559a Remove unused variable 2021-01-26 21:37:16 +00:00
Damien Elmes
31a3add848 fix finished screen not showing when learning cards due later 2021-01-25 21:12:57 +10:00
Damien Elmes
2a875ffc55
Merge pull request #934 from hgiesel/graphprefs
Add GraphsPreferences API to graphs for setting persistent preferences
2021-01-23 21:24:41 +10:00
Damien Elmes
37ca8afaf6 minor wording tweak: GraphsPreferences -> GraphPreferences 2021-01-23 20:47:45 +10:00
Damien Elmes
10757d563d refresh new/rev counts when fillNew/fillRev() fails
This was the behaviour before, but got lost when ._reset_counts() was
added. Also added the check back to schedv2:fillRev(), which also
appears to have gotten lost in the move to ._reset_counts()

Just a stop-gap fix until this code can get a proper rewrite.
2021-01-23 14:02:05 +10:00
Damien Elmes
ce2315591f remove "invalid current deck"
This should resolve itself when a user clicks on a deck.
2021-01-23 13:04:58 +10:00
Henrik Giesel
bf130d1da0 Change the function name in genbackend.py 2021-01-22 20:05:28 +01:00
Henrik Giesel
665a13e378 Add GraphsPreferences endpoint to backend 2021-01-22 13:13:48 +01:00
abdo
bf0086d565 Use new backend filters in rename_tag() 2021-01-16 18:49:48 +03:00
abdo
e018ea94b6 Merge branch 'master' of https://github.com/ankitects/anki into tagtree 2021-01-15 01:12:01 +03:00
abdo
2ff584c44d Pass escaped name to bulk_update in rename_tag 2021-01-14 18:38:46 +03:00
abdo
9c1d7c522a Refactor code for clearing unused tags and saving collapse state 2021-01-14 07:04:14 +03:00
RumovZ
7b9cc017c4 Use backend to set dupe filter 2021-01-14 10:42:37 +10:00
Damien Elmes
633034b24d add local sync server frontend 2021-01-13 11:42:00 +10:00
abdo
72e8f9d640 Merge branch 'master' of https://github.com/ankitects/anki into tagtree 2021-01-12 23:31:58 +03:00
Damien Elmes
fbd91b22f5 tidy up UTC offset handling/timing calculations
- use the TimestampSecs newtype instead of raw i64s
- use FixedOffset instead of a minutes_west offset
- check localOffset each time the timing is calculated, and set it
if it's stale - even for v1.
- check for and fix missing rollover when calculating timing
- stop explicitly passing localOffset in the sync/start call
2021-01-12 21:32:56 +10:00
Damien Elmes
9bc8434538 remove temporary sync/dbcheck logging 2021-01-12 18:47:08 +10:00
Damien Elmes
1425379d41 drop basicCheck()
It can considerably slow down syncing on large collections
2021-01-12 18:47:08 +10:00
Damien Elmes
401d5dd9cc
Merge pull request #917 from hgiesel/querynozero3
Coerce added/edited:0 to 1, Constrain rated:n to 1-365
2021-01-11 16:24:12 +10:00
Henrik Giesel
250b89be60 Adjust pyblib test_find 2021-01-10 16:25:52 +01:00
RumovZ
942632d579 Also add FilterToSearch to want_release_gil() 2021-01-10 11:31:00 +01:00
RumovZ
b763fc5b2a Use explicit wrapper functions to get filters 2021-01-09 16:48:47 +01:00
abdo
f7f509c70d Move tag collapse method to the backend 2021-01-09 17:10:16 +03:00
abdo
b33267f754 Do not check for missing tag parents at registration time 2021-01-09 17:10:16 +03:00
abdo
b276ce3dd5 Hierarchical tags 2021-01-09 17:10:13 +03:00
RumovZ
b99d9cda74 Prettify frontend filter code 2021-01-09 12:34:46 +01:00
RumovZ
fda2bfdb4e Use backend filters instead of literal searches 2021-01-09 10:51:15 +01:00
RumovZ
efd554ea29 Provide ConcatSeparator through rsbackend.py 2021-01-07 17:48:30 +01:00
RumovZ
c2e2a86ec9 Add writer functions to want_release_gil() 2021-01-07 13:09:00 +01:00
Damien Elmes
b30b7c3073 fix qt/ pylints 2021-01-07 16:21:50 +10:00
Damien Elmes
f9e939aaff Make orjson optional again
While 32 bit platform support is probably not going to come back,
this allows Anki to run on other architectures orjson doesn't support.
2021-01-07 09:44:40 +10:00
Damien Elmes
dad4c76089 no need to log card resets when exporting 2021-01-05 11:11:37 +10:00
Damien Elmes
f3fa9daae2 do tag rename and tag clearing in background; move logic to tags.py
Because the logic is in rename_tag() now, it means we create a
checkpoint even if the tag is orphaned. This is because currently
checkpointing is a GUI responsibility. In the future we need to introduce
multi-level undo, and should move responsibility for managing it
to the backend.
2021-01-04 14:14:39 +10:00
Damien Elmes
db3308e788 add linux_arm64 platform 2020-12-29 18:40:39 +10:00
Damien Elmes
a1498e9e81
Merge pull request #866 from guillem-palau-salva/master
Update consts.py
2020-12-29 10:15:42 +10:00
Damien Elmes
cb93a0909c
Merge pull request #872 from RumovZ/fix-deck-check
Fix deck check and thus blue sync arrow bug
2020-12-29 10:11:59 +10:00
RumovZ
9f18e12cb8 Fix deck check and thus blue snyc arrow bug
Cast col.decks.selected() to int so the return type fits the annotation.
Thus, fix the comparison in col.decks.select() which was leading to
a superfluous db modification and in turn to a false indication of a
necessary sync right after another one in certain cases.
2020-12-29 00:29:36 +01:00
Guillem Palau-Salvà
870df16b01 Update consts.py
I notices that type 4 is added in the revlog when rescheduling. Reviews are logged as 0 time and type 4.
2020-12-27 01:02:32 +01:00
Damien Elmes
c4382e38a1 update to stable pyo3 0.13 release 2020-12-23 10:08:38 +10:00
Damien Elmes
212b251334 tag the wheels as manual so test ... doesn't build them 2020-12-21 19:28:47 +10:00
Damien Elmes
73679b03e7 possible fix for sync button colour blue after sync
If the client's clock is behind AnkiWeb's, even by a few seconds,
we can end up with a situation where last_begin_at is updated after
the sync to a value less than the mtime we received from AnkiWeb,
causing the collection to be saved, which bumps the modtime.

Work around this by recording mtime at begin() time, and seeing if it
has changed in either direction.

Thanks to Rumo, who did the hard work looking into it:
https://forums.ankiweb.net/t/why-is-my-sync-button-blue/2078/21
2020-12-21 19:27:26 +10:00
Damien Elmes
e99a7c0f90 tweak naming and move method into col.decks 2020-12-20 10:26:16 +10:00
k12ish
cc0572a385 Added type hints, renamed kwarg 2020-12-19 18:12:58 +00:00
k12ish
ef1f58c8b6 Added method 2020-12-19 17:59:07 +00:00
Damien Elmes
af92bb5e93 exhaustiveness checks on literals are now possible with the move to py38 2020-12-18 16:50:55 +10:00
Damien Elmes
ecb7c1482f use QtMultimedia for recording instead of PyAudio
The unmute-on-first-duration-change approach is to try to prevent
clicks/pops that can happen at the start of recordings. If it doesn't
solve the problem, we may need to drop down to the lower-level
QAudioInput().

Closes https://github.com/ankitects/help-wanted/issues/23

May fix https://forums.ankiweb.net/t/anki-crashes-periodically-after-clicking-record-audio-button/5824,
which I suspect was caused by processEvents()
2020-12-16 19:33:25 +10:00
Damien Elmes
a61f3bbc48 fix some warnings on startup 2020-12-16 15:38:24 +10:00
Damien Elmes
c8f989239b remove conditional rsbackend_gen import
It causes PyCharm to think methods are missing on col.backend, and
should not be needed with the move to Bazel.
2020-12-16 13:30:54 +10:00
Damien Elmes
937247ab06 add type stub for _rsbridge to make PyCharm happy 2020-12-16 13:13:42 +10:00
Damien Elmes
53276b3044 symlink generated .py/.pyi into tree to fix Python code completion 2020-12-16 11:36:42 +10:00
Damien Elmes
1b98e7e48f add ability to specify an individual Python test 2020-12-16 10:40:29 +10:00
Damien Elmes
1da327c725 minor doc updates 2020-12-11 22:37:12 +10:00
Damien Elmes
13d66b22f4 remove unwanted leading '/' in wheel records 2020-12-10 23:02:18 +10:00
Damien Elmes
0cbb60169c simplify wheel building 2020-12-10 20:27:21 +10:00
Damien Elmes
85b7e1c623 drop unused i686 references
https://forums.ankiweb.net/t/changing-ankis-build-system-to-bazel/4737/9
2020-12-09 15:45:01 +10:00
Damien Elmes
4c3577b12e update Rust deps incl. Pyo3
This includes the refcount bug fix from pyo3 0.12.4
2020-12-01 16:48:45 +10:00
Damien Elmes
be6bd1322d expose Gaelic in language selection 2020-11-30 14:44:29 +10:00
Damien Elmes
c9b3ed1eae switch to workspace for Rust code 2020-11-24 18:41:03 +10:00
Damien Elmes
d85d0b88a1
Merge branch 'master' into init-lang 2020-11-22 16:10:49 +10:00
Damien Elmes
0b848eae56 update remaining python format strings to Fluent 2020-11-22 14:57:53 +10:00
abdo
7d7745fbb5 Set up default language before loading profile
We can make more strings translatable this way.
2020-11-21 05:29:23 +03:00
Damien Elmes
e23d40e850
Merge pull request #823 from RumovZ/rework-search-parser
Rework search parser
2020-11-20 16:22:12 +10:00
abdo
e3b4802f47 Fix description of exporters
Description broke yet again with the full migration to Fluent
2020-11-19 23:52:46 +03:00
RumovZ
cb2c19aced Add Python test for tag whitespace
Assert tag matches do not occur across different tags.
2020-11-19 09:28:19 +01:00
RumovZ
c185fb966b Merge branch 'master' into rework-search-parser
Conflicts:
    rslib/src/search/sqlwriter.rs
2020-11-18 09:04:04 +01:00
Damien Elmes
a86ce5a1d4 remove print statement from unit tests 2020-11-18 13:56:44 +10:00
Damien Elmes
1c5f94d46f strip out unused gettext refs 2020-11-18 13:22:51 +10:00
Damien Elmes
ffa26fe4bc fix remaining _() references; remove unused imports 2020-11-18 12:43:46 +10:00
Damien Elmes
177d98489a update pylib ngettext references 2020-11-18 09:12:25 +10:00
Damien Elmes
e9cd956acd drop i18n references in old stats 2020-11-18 09:12:03 +10:00
Damien Elmes
2453e5c488 update temporary val="%s" references to standard ftl 2020-11-17 22:00:44 +10:00
Damien Elmes
9d1b6231d7 merge pylib references 2020-11-17 19:23:06 +10:00
Damien Elmes
44489a480f map gettext strings to keys/modules for ftl conversion 2020-11-17 14:11:09 +10:00
RumovZ
d1ee507b3a Update frontend test to new escape handling 2020-11-15 09:39:10 +01:00
Damien Elmes
8e93b0ee38 use full path in backend_pb2 import 2020-11-13 14:21:21 +10:00
Damien Elmes
5bb3d7c114 format_fix -> format; rename svelte-check for consistency 2020-11-12 20:19:32 +10:00
Damien Elmes
2897707263 update Python deps 2020-11-12 20:03:41 +10:00
Damien Elmes
b0aedd6c76 orjson was missing from dep list; drop 32 bit compat 2020-11-12 20:03:41 +10:00
Damien Elmes
8ca023048a add coding specifier to anki/__init__.py
older gettext versions will complain otherwise (was breaking Windows CI)
2020-11-11 21:51:11 +10:00
Damien Elmes
0fcccae6e8
Merge pull request #817 from cecini/formatcheck
Update mypy and black format check to python version 3.8
2020-11-11 21:36:32 +10:00
Damien Elmes
8d4df820cc update i18n scripts
- export updated .po files for consumption
- add a script to pull and push translations
2020-11-11 21:08:06 +10:00
cecini
62da8e6a40 Update mypy and black format check to python version 3.8 2020-11-11 09:24:28 +00:00
Damien Elmes
fd5815653f fix error exporting v2 collection when translations don't match
https://forums.ankiweb.net/t/utf8-error-in-importing-deck/4430/13
2020-11-11 15:42:08 +10:00
Damien Elmes
6e3f971ae1 handle packaged pylib buildinfo.txt; drop aqt buildinfo 2020-11-11 10:33:49 +10:00
Damien Elmes
e99c0dbe15
Merge pull request #793 from nwwt/object-audio-tags-support
Audio & object tag support
2020-11-11 10:33:31 +10:00
Andreas Reis
e68a40f13e 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
ianki
c2901e4859 Add hooks for filtering media. 2020-11-09 02:12:23 -08:00
Damien Elmes
29ae7480f2 cleanups 2020-11-05 11:21:13 +10:00
Damien Elmes
95317a4f17 fix backend_pb2 race 2020-11-05 11:02:40 +10:00
Damien Elmes
927a44e36e unused import 2020-11-04 21:04:42 +10:00
Damien Elmes
0d354da93a move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
Damien Elmes
9fe53ff549 switch to the stable Python ABI
Should allow the library to be imported in both Python 3.8+3.9.
2020-11-03 20:29:07 +10:00
Alan Du
562ea403b3 Update to PyO3 0.12
+ cargo raze by Damien
2020-11-02 18:38:34 +10:00
Damien Elmes
dc3bd07919 update cargo deps; add script to copy them from rslib/ 2020-11-02 18:17:26 +10:00
Damien Elmes
e0817c004d move backend.proto into rslib/ 2020-11-02 16:28:31 +10:00
Damien Elmes
45ed97c56c rspy -> pylib/rsbridge 2020-11-02 15:21:12 +10:00
Damien Elmes
b17d537a9e remove old makefiles 2020-11-01 14:41:01 +10:00
Damien Elmes
aea0a6fcc6 initial Bazel conversion
Running and testing should be working on the three platforms, but
there's still a fair bit that needs to be done:

- Wheel building + testing in a venv still needs to be implemented.
- Python requirements still need to be compiled with piptool and pinned;
need to compile on all platforms then merge
- Cargo deps in cargo/ and rslib/ need to be cleaned up, and ideally
unified into one place
- Currently using rustls to work around openssl compilation issues
on Linux, but this will break corporate proxies with custom SSL
authorities; need to conditionally use openssl or use
https://github.com/seanmonstar/reqwest/pull/1058
- Makefiles and docs still need cleaning up
- It may make sense to reparent ts/* to the top level, as we don't
nest the other modules under a specific language.
- rspy and pylib must always be updated in lock-step, so merging
rspy into pylib as a private module would simplify things.
- Merging desktop-ftl and mobile-ftl into the core ftl would make
managing and updating translations easier.
- Obsolete scripts need removing.
- And probably more.
2020-11-01 14:26:58 +10:00
Andreas Reis
6e9aaad11e Add audio & object tags to media check
Makes the media check recognize files in <audio> and <object> tags as used.

They've been observed/supported by the WebView (checked: Anki, AnkiDroid) since just about forever already and are extremely useful if one knows a thing about web dev.
2020-10-25 13:09:57 +01:00
Arthur Milchior
d6dd1849cf NF: uses consts and update comment according to code 2020-10-15 08:22:23 +02:00
Damien Elmes
a4a461c17b
Merge pull request #782 from johan456789/patch-1
fix outdated help site
2020-10-12 12:15:46 +10:00
Damien Elmes
727ddd74b6 fixes for latest mypy 2020-10-10 19:02:59 +10:00
johan456789
e8e5314a97
fix outdated help site 2020-10-07 19:38:49 +08:00
Damien Elmes
53a984ba15 bump version 2020-10-02 10:22:21 +10:00
Arthur Milchior
7850d2d662 NF: uses consts in col 2020-09-27 09:01:47 +02:00
Damien Elmes
c125893eba bump version 2020-09-24 10:52:24 +10:00
Arthur Milchior
51ba2b5870 NF: remove _changedGuids
Nothing is ever added to the map.
That was a bug detected by lint in ankidroid
2020-09-21 06:02:10 +02:00
Damien Elmes
45724a0474 small learning steps were being stored as a float
https://forums.ankiweb.net/t/bug-with-fractional-learning-intervals/3524/5
2020-09-20 10:29:39 +10:00
Damien Elmes
ade7f438ce rebuild_filtered_deck() and new_filtered() 2020-09-03 18:02:47 +10:00
Damien Elmes
f87fa762be empty_filtered_deck() 2020-09-03 17:43:07 +10:00
Damien Elmes
56ceb6ba76 set_deck() 2020-09-03 17:42:46 +10:00
Damien Elmes
b65174a026 move card sorting and resetting to backend 2020-09-03 15:54:15 +10:00
Damien Elmes
ce49ca9401 log manual reschedule, but ignore the log entry in the stats 2020-09-02 17:56:23 +10:00
Damien Elmes
39212a38aa move reschedCards() to backend 2020-09-02 17:56:23 +10:00
Damien Elmes
8f9037cf0f move filtered deck empty/fill to backend
emptying of individual card ids still to be done
2020-09-02 17:56:23 +10:00
Damien Elmes
8d2867aa2d fix night mode on old graphs 2020-09-02 17:56:12 +10:00
Damien Elmes
a834df60ce rename some card+note fields in backend 2020-09-01 10:24:38 +10:00
Damien Elmes
d3dede057a move bury/suspend into backend 2020-09-01 10:24:38 +10:00
Damien Elmes
ac265fe75a formatting fixes for latest black 2020-09-01 10:24:38 +10:00
Damien Elmes
ccfa989c62 move unbury/unsuspend routines into backend 2020-09-01 10:24:38 +10:00
Damien Elmes
e5685254c6 reimplement congrats screen in Rust+Typescript 2020-09-01 10:24:38 +10:00
Damien Elmes
5a4043524a add missing pylint/isort deps 2020-08-31 14:07:04 +10:00
Damien Elmes
a517accee3 update to latest black 2020-08-31 13:29:28 +10:00
Damien Elmes
603210149c update to latest isort, pylint and pytest 2020-08-31 12:05:36 +10:00
Damien Elmes
20432ccecf fix new pylint raise-missing-from lint 2020-08-31 12:04:14 +10:00
Damien Elmes
819dce3ab6 bump version 2020-08-31 11:07:54 +10:00
Damien Elmes
4662a9fe1a check if we need to unbury at the start of the sync process
https://forums.ankiweb.net/t/bug-buried-cards-in-filtered-decks-not-being-unburied-next-day/2541/24
2020-08-28 21:09:07 +10:00
Damien Elmes
96f9ad1f25 fix next learn message overestimating delay
https://forums.ankiweb.net/t/bug-with-short-intervals-in-anki-2-1-scheduler/2678
2020-08-27 09:35:31 +10:00
Damien Elmes
5355c3c25e fix description in export screen (thanks to ANH)
https://forums.ankiweb.net/t/anki-2-1-31-exporting-display-bug/2669/3
2020-08-26 08:33:35 +10:00
Damien Elmes
7e6a65ed3d bump version 2020-08-26 08:05:45 +10:00
Damien Elmes
7d7c791504 bump version 2020-08-24 11:28:22 +10:00
Damien Elmes
d266f9a80a revlog entry should not be deleted when undoing preview card
The plan is to add a revlog entry when previewing in the future; this
is just a temporary fix.
2020-08-19 16:44:06 +10:00
Arthur Milchior
c4db4bd291 Any removed 2020-08-12 01:37:21 +02:00
Arthur Milchior
c3b2b8625e NF: childMapNode 2020-08-12 00:42:42 +02:00
Damien Elmes
b380f304bf bump version 2020-08-09 13:44:59 +10:00
Damien Elmes
760ce2282d previous fs encoding test didn't catch things like latin-1
https://forums.ankiweb.net/t/unicodeencodeerror-when-syncing/1746
2020-08-03 11:29:07 +10:00
Damien Elmes
5a73641b57 enable strict equality checks in mypy
Without it, the following code reports no problems:

def foo() -> int:
    return 5
print(foo == 5)
2020-08-03 10:26:40 +10:00
Damien Elmes
2bcf9a82d1 fix missing translations in export screen
https://forums.ankiweb.net/t/untranslated-strings/1623
2020-07-31 13:33:41 +10:00
Damien Elmes
186ff1f185 pin pytest due to pylint issue 2020-07-29 14:52:45 +10:00
Matt Krump
5e6f532f56 Turn on check_untyped_defs for aqt.exporting 2020-07-28 18:42:22 -06:00
Damien Elmes
227703f9fa bump version 2020-07-28 12:59:56 +10:00
Damien Elmes
9f3eebfa80 force old graphs to use ltr
otherwise the axis labels are way off

https://forums.ankiweb.net/t/anki-2-1-29-beta/1220/8
2020-07-22 14:30:56 +10:00
Damien Elmes
412f1777bd bump version 2020-07-21 15:54:14 +10:00
Damien Elmes
01ff6ab55d apply rtl dir to webviews
https://forums.ankiweb.net/t/gui-problems-with-right-to-left-languages/1205
2020-07-21 11:52:25 +10:00
Damien Elmes
15f13145ea
Merge pull request #698 from Arthur-Milchior/remove_clear_overdue
remove _clearOverdue
2020-07-21 10:27:04 +10:00
Arthur Milchior
a3f8a15c37 remove unused variable 2020-07-20 10:17:23 +02:00
Arthur Milchior
5c9c5f6ebc duplicate assignment removed 2020-07-20 06:47:47 +02:00
Arthur Milchior
e02d47a0d9 typo 2020-07-20 06:28:36 +02:00
Arthur Milchior
0449785b7a remove useless variable cram 2020-07-20 06:24:42 +02:00
Arthur Milchior
3fd16beaa5 remove _clearOverdue
This member is never read
2020-07-20 05:45:18 +02:00
Damien Elmes
67abb98993
Merge pull request #692 from Arthur-Milchior/remove_useles_variables
Remove useless variables
2020-07-20 11:35:40 +10:00
Damien Elmes
928a1d3a75
Merge pull request #697 from Arthur-Milchior/typos
Comment typo
2020-07-20 11:34:02 +10:00
Damien Elmes
2bb5826598
Merge pull request #696 from Arthur-Milchior/note_to_add_note
For some reason, add_note were assigned to a unused variable
2020-07-20 11:32:55 +10:00
Damien Elmes
63c0557824
Merge pull request #695 from Arthur-Milchior/note->field
replace "note" by "field"
2020-07-20 11:32:30 +10:00
Arthur Milchior
ff62829e6e Comment typo 2020-07-19 11:24:58 +02:00
Arthur Milchior
35cfbc2bae For some reason, add_note were assigned to a unused variable
I remove it for clarity
2020-07-19 10:58:40 +02:00
Arthur Milchior
bff784dc9a replace "note" by "field"
My bad. In one case `f` did represent "field" and not "fact"
2020-07-19 08:24:43 +02:00
Arthur Milchior
23eeb84556 Uses constant in tests 2020-07-19 05:34:22 +02:00
Arthur Milchior
1b4a180fb9 d2->col2 2020-07-17 17:55:57 +02:00
Arthur Milchior
e7d75c2c8d tmp->col in tests 2020-07-17 17:37:17 +02:00
Arthur Milchior
e7378734d2 f4->note4 2020-07-17 17:34:39 +02:00
Arthur Milchior
0db941ed98 f3->note3 2020-07-17 17:33:58 +02:00
Arthur Milchior
9c5bb199d0 f->n in id 2020-07-17 17:30:29 +02:00
Arthur Milchior
93ad194862 NF: deck2->col2 2020-07-17 17:27:40 +02:00
Arthur Milchior
452daf8d80 Remove useless variables 2020-07-17 08:38:48 +02:00
Arthur Milchior
1af59545bd gn->deckn in test
Obtained by
```
sed -i "s/\bg1\b/deck1/g" pylib/tests/*py qt/tests/*py
sed -i "s/\bg2\b/deck2/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:58:32 +02:00
Arthur Milchior
2c73dcb2e5 d->col in tests
obtained by
```
sed -i "s/\bd\b/col/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:58:32 +02:00
Arthur Milchior
c376714a9b deck->col in tests
Obtained by
```
sed -i "s/\bdeck\b/col/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:50:46 +02:00
Arthur Milchior
425b82e6e7 f2->note2 in test
Obtained by
```
sed -i "s/\bf2\b/note2/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:47:44 +02:00
Arthur Milchior
4c25835d27 f->note in test
Obtained by sed -i "s/\bf\b/note/g" pylib/tests/*py qt/tests/*py
2020-07-17 06:47:44 +02:00
Arthur Milchior
6a529e51cc note->n
Next commit will transform f into note, and this lead to a variable clash here
2020-07-17 06:08:33 +02:00
Damien Elmes
19541c4a9d fix deck tree with a day delta, and support arbitrary timestamps 2020-07-06 19:16:03 +10:00
Damien Elmes
4d23a69e9a formatting 2020-07-01 14:01:24 +10:00
Damien Elmes
572e2d10dc hack around future unburied date
We want to avoid unburied != self.today, because the unburied time
is synchronized as part of the collection at the moment, and we don't
want a client with an older unburied time that was modified more
recently to cause cards to be unburied twice - so we only unbury
if today is more than 7 days earlier than the last unbury time.

Unsure what caused these users to end up in that state in the first
place:
https://anki.tenderapp.com/discussions/ankidesktop/41335-cards-remain-buried-forever-unless-manually-unburied
2020-07-01 13:12:45 +10:00
Damien Elmes
82568a1f3e experiment with exposing raw card/revlog data to frontend 2020-06-29 15:48:00 +10:00
Damien Elmes
3ca4a13cf2 protobuf package should be in PascalCase 2020-06-29 15:48:00 +10:00
Damien Elmes
d99ea0c7a0 fix media not working after full sync 2020-06-24 09:52:02 +10:00
Damien Elmes
83b3d3249f drop yellow colour in "filtered" for now
It's difficult to read against a light background
2020-06-16 16:39:07 +10:00
Damien Elmes
b51f03085e migrate card stats to backend
Currently this renders the HTML directly like the previous Python
implementation - doing it in JS would probably make more sense in the
future.
2020-06-15 17:22:16 +10:00
Damien Elmes
772c7a945c fix lint issues with latest mypy_protobuf 2020-06-14 15:38:43 +10:00
Damien Elmes
8e895aa247 handle db errors the same way as other backend requests 2020-06-12 20:39:02 +10:00
Damien Elmes
1cb0ac3670 update unit test for leech change 2020-06-09 14:12:34 +10:00
Damien Elmes
c4ead8ad28 strip out \r on export
(private post)
https://anki.tenderapp.com/discussions/ankidesktop/42315-bug-report-exporting-selected-cards-in-browser-issue
2020-06-09 12:56:16 +10:00
Damien Elmes
8bac28470f fix error when importing v2 apkg
https://anki.tenderapp.com/discussions/ankidesktop/42070-anki-closes-without-warning-when-importing-conflicting-shared-deck
2020-06-09 12:06:52 +10:00
Damien Elmes
b277849db1 fix audio being included in FrontSide 2020-06-09 08:16:03 +10:00
Damien Elmes
7c444b4d35 add progress to db check 2020-06-08 21:07:36 +10:00
Damien Elmes
4570ae3d12
Merge pull request #658 from BlueGreenMagick/media-type
add type hint for media dir
2020-06-08 11:31:01 +10:00
Damien Elmes
4df3777aed fix legacy deckDueTree() 2020-06-08 11:12:24 +10:00
BlueGreenMagick
c6ec9e44e4 add type hint for media dir 2020-06-07 10:35:48 +09:00
Damien Elmes
1fe18718f7 add daily count updating to backend 2020-06-05 19:49:53 +10:00
Damien Elmes
fee6cdff22 support generating a due tree for a different date 2020-06-05 09:38:31 +10:00
Damien Elmes
4a69b55a90 add note/card removal to backend 2020-06-04 18:21:04 +10:00
Damien Elmes
e1b0fe1832 add .count() to hooks, and list->sequence in note deletion 2020-06-04 18:20:03 +10:00
Damien Elmes
14a5ab353e fix duplicate/empty check 2020-06-02 17:34:34 +10:00
Damien Elmes
4d7e23111e 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
5729e9e336 "fix" v1 scheduler breaking after burySiblings change 2020-06-01 19:44:25 +10:00
Damien Elmes
90e19daec2 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
c6f0710ce7 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
aecce5a516 fix mtime being bumped in .reset() 2020-06-01 13:57:10 +10:00
Damien Elmes
42302b070e fix de-auth when no media DB set up 2020-06-01 13:57:10 +10:00
Damien Elmes
0e5b7da62a login/full up/full down plugged in 2020-06-01 13:57:10 +10:00
Damien Elmes
ee6d7f82e7 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
6204a86879 tidy up sibling burying
closes #649
2020-06-01 13:48:15 +10:00
Damien Elmes
8516ed8655 handle images served from directory + svg content type
https://anki.tenderapp.com/discussions/ankidesktop/41974-win-linux-when-pasting-some-html-i-get-error-in-_run_command-ankirsbackendioerror-ioerror
2020-06-01 13:40:17 +10:00
Damien Elmes
8f9c6fbf95
Merge pull request #643 from evandroforks/add_repr_functions
Added __repr__ functions to common objects
2020-06-01 13:29:21 +10:00
evandrocoan
3318f23ff3 Say which card failed with an exception 2020-05-31 19:41:18 -03:00
evandrocoan
ef5c38dbc6 Added super().__repr__() to new __repr__() calls 2020-05-31 19:39:19 -03:00
evandrocoan
1e216e47ed Added __repr__ functions to common objects 2020-05-31 19:39:19 -03:00
Damien Elmes
97618564f4 fix typechecking breaking with latest mypy_protobuf
the change that caused it:
https://github.com/dropbox/mypy-protobuf/issues/118

This is more awkward to handle now, as the types are only available
at type-checking time. Python's static typing is such a mess :-(
2020-05-27 09:14:02 +10:00
Damien Elmes
3e156911e7 avoid printing the original exception bytes
Prevents the "while processing this exception, another exception
occurred" message
2020-05-25 14:28:37 +10:00
Damien Elmes
015de0c51f move generated methods into separate, gitignored file 2020-05-24 20:41:53 +10:00
Damien Elmes
c8d13209cd move dupe check to backend 2020-05-24 19:48:56 +10:00
Damien Elmes
38508c3ad7 use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
Damien Elmes
89dde3aeb0 migrate the remaining methods 2020-05-24 08:36:50 +10:00
Damien Elmes
4bf8175bcb migrate more scheduling/media/etc
almost there
2020-05-23 21:34:19 +10:00
Damien Elmes
a105037ec9 migrate notetypes, update GIL list 2020-05-23 20:43:55 +10:00
Damien Elmes
6710e3d528 add some more newtypes to the RPC defs 2020-05-23 16:58:01 +10:00
Damien Elmes
95735f106a migrate cards and notes 2020-05-23 16:19:48 +10:00
Damien Elmes
7550e6241c migrate decks and dconf methods 2020-05-23 15:09:16 +10:00
Damien Elmes
081a61a438 more methods 2020-05-23 14:01:36 +10:00
Damien Elmes
175afa9fee migrate more methods to service 2020-05-22 22:09:33 +10:00
Damien Elmes
9c20d9a02b 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
0bf4fe400a fix deletion of decks; allow deleting cards from default
https://anki.tenderapp.com/discussions/beta-testing/1967-2126-189-g7384df8f-crash-at-note-types-fields-save#comment_48353232
2020-05-22 11:24:56 +10:00
Damien Elmes
9baa8530d5 move deck/notetype update hooks to gui
We need to migrate away from firing hooks in libanki, since libanki
methods may be running on a background thread, and hook consumers
typically expect the code to run in the main thread. We could document
it, but it would frequently be forgotten about, and could lead to
crashes.

https://anki.tenderapp.com/discussions/ankidesktop/41748-qobject-cannot-create-children-for-a-parent-that-is-in-a-different-thread-when-hitting-the-save-button-on-clayoutpy-window
2020-05-22 10:47:14 +10:00
Damien Elmes
1844cc84cc can't use _card.note_type() in clayout 2020-05-22 09:58:58 +10:00
Damien Elmes
c52a076176 add back most of .fields() to avoid breaking add-ons 2020-05-21 12:08:51 +10:00
Damien Elmes
44ca4b32eb use longer delay in test_timing()
was intermittently failing in slow Windows CI
2020-05-21 09:33:49 +10:00
evandrocoan
b388c43454 Fixed HttpClient session not being closed 2020-05-20 19:20:41 -03:00
Damien Elmes
d5e48fdf65 fix deck age being used instead of collection
https://anki.tenderapp.com/discussions/ankidesktop/41637-bug-in-statistics
2020-05-20 19:46:01 +10:00
Damien Elmes
e2bb5cd14a update missed storage._Collection references 2020-05-20 19:45:46 +10:00
Damien Elmes
50fdf9b03d storage->collection 2020-05-20 17:58:28 +10:00
Damien Elmes
c49c378296 move storage logic into collection.py; fix export bug
https://anki.tenderapp.com/discussions/ankidesktop/41495-using-file-export-closes-the-collection-on-mwcoldb-if-the-browser-window-is-open
2020-05-20 17:43:34 +10:00
Damien Elmes
0c85397461 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
7384df8f19
Merge pull request #613 from evandroforks/add_missing_file_descriptors_close
Add missing close file descriptors using context managers
2020-05-19 14:39:07 +10:00
Damien Elmes
e17d63083c catch protobuf error as well
Sad that we can't exhaustively match protobuf oneofs in
Python :-(
2020-05-19 13:10:20 +10:00
evandrocoan
083cc8ae4e Simplified csvfile.py super call __del__ call 2020-05-18 16:20:33 -03:00
evandrocoan
200bad3714 Explicitly close the importer file descriptor
https://github.com/ankitects/anki/pull 613
2020-05-18 15:54:20 -03:00
evandrocoan
efb62b9528 Add missing close file descriptors using context managers 2020-05-18 15:54:20 -03:00
Damien Elmes
8bd5d756e2 bump version 2020-05-18 12:50:20 +10:00
Damien Elmes
68465ae07b protobuf tidyups 2020-05-18 09:26:14 +10:00
Damien Elmes
7ec3f1ecc0 fix syncing 2020-05-17 20:52:02 +10:00
Damien Elmes
69537bb748 minor tidyups in decks.py 2020-05-17 20:13:29 +10:00
Damien Elmes
803aeff16e update current note type in backend 2020-05-17 20:01:16 +10:00
Damien Elmes
7daa417dc8 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
df48fa8cf7 handle deletion of default deck in backend; use + instead of _ 2020-05-17 15:22:19 +10:00
Damien Elmes
252eb3a444 fix shared deck conf warning 2020-05-17 14:37:59 +10:00
Damien Elmes
b9b837e7bd update before_upload() 2020-05-17 14:13:21 +10:00
Damien Elmes
6114836484 move deck config to protobuf 2020-05-17 13:28:41 +10:00
Damien Elmes
54670580ad add option to limit deck tree counts to a particular node 2020-05-17 08:38:49 +10:00
Damien Elmes
8b57a61746 use deck tree for new/review count calculation
- wins back the performance lost by the decks and dconf not being
in memory, and the overhead of serializing data for DB calls
- card counts are no longer capped to 1000
- learn counts are currently still calculated separately - can't merge
v1 counts without changing the existing behaviour
- partially rendering the tree may yield more savings
2020-05-16 20:28:03 +10:00
Damien Elmes
5590b22683 speed up children() and add deck_and_child_ids() 2020-05-16 15:40:07 +10:00
Damien Elmes
2efda14200 rework and merge updateCutoff
- the old "mutate but don't save" approach to resetting the "done today"
counts no longer works, and was inefficient anyway - now we just check
the day when returning the count
- remove separate implementation for v1 scheduler

This is a stop-gap solution - a bigger refactor will need to wait
until the deck/note type changes have stabilized.
2020-05-16 15:14:16 +10:00
Damien Elmes
bd1ce123af formatting 2020-05-16 14:59:47 +10:00
Damien Elmes
1cddd6d23e only update active when selecting deck/resetting
We were previously doing this every time a card was answered.
2020-05-16 14:57:46 +10:00
Damien Elmes
8eada2b57d add find_deck_in_tree() 2020-05-16 13:05:20 +10:00
Damien Elmes
24dd116f91 update unit tests to use deck_due_tree() 2020-05-16 12:10:40 +10:00
Damien Elmes
f2086fc2e3 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
4d5908dc20 remove unused default(Dynamic)Deck 2020-05-15 21:47:33 +10:00
Damien Elmes
964a69e54e handle default deck and filtered deck suppression in the backend 2020-05-15 21:21:10 +10:00
Damien Elmes
769bf04f75 remove unused deckDueList() and associated tree code
The progress bar add-ons appear to be the only active users of it;
they can switch their old code from iterating over the list to
simply locating the selected deck in deckDueTree(), as its counts should
summarize all the child decks.
2020-05-15 18:37:12 +10:00
Damien Elmes
e44b3bf93c reuse stock basic type for default field/notetype/etc
Could add extra methods in the backend to allocate these in the
future, but as this is not a hot path, this should do for now.
2020-05-15 17:35:00 +10:00
Damien Elmes
2ac33500eb fetch stock notetypes from backend 2020-05-15 17:08:24 +10:00
Damien Elmes
f650e5557f add back card deletion count
cheaper to look up now that there's an index on notes.mid
2020-05-15 15:28:07 +10:00
Damien Elmes
7c5980a941 <= in modified_after_begin for unit tests 2020-05-15 14:24:59 +10:00
Damien Elmes
46c363d4aa track changes in fields dialog as well
And avoid bumping schema until user actually saves, but warn at
start.
2020-05-15 13:59:44 +10:00
Damien Elmes
a2b7a30841 fetch/set remaining collection properties as required 2020-05-15 13:33:37 +10:00
Damien Elmes
31480be5e7 fix exporting bug
can't/shouldn't pop up confirmation message on export
2020-05-15 11:03:34 +10:00
Damien Elmes
782911471b add "fill empty" checkbox 2020-05-14 20:58:45 +10:00
Damien Elmes
5167bb57be start reworking card layout screen
- front/back/css shown in tabs
- front/back preview switchable; only one webview needs to be loaded
- dropdown to select cloze number in preview
- search box to search in front/back/css
2020-05-14 15:24:29 +10:00
Damien Elmes
f23eb350e4 drop availOrds(), and use backend for getting cloze numbers 2020-05-14 12:14:00 +10:00
Damien Elmes
9f676dbe0b remove availOrds() check in importer
Like adding individual cards, we now support importing material even
if it wouldn't generate any cards, and the old availOrds check can't
handle negated conditionals.
2020-05-14 10:27:54 +10:00
Damien Elmes
c601dcef24 remove obsolete preview code 2020-05-14 09:22:53 +10:00
Damien Elmes
6680cdf1d3 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
12b8fe6147 don't hide static template text when card is empty 2020-05-13 11:17:44 +10:00