Commit graph

9494 commits

Author SHA1 Message Date
RumovZ
60c6869a05 target[_id]s → existing_card[_id]s 2022-04-27 21:48:19 +02:00
RumovZ
07ff01f96d Fix sorting of imported decks
Also adjust the test, so it fails without the patch. It was only passing
before, because the parent deck happened to come before the
inconsistently capitalised child alphabetically. But we want all parent
decks to be imported before their child decks, so their children can
adopt their capitalisation.
2022-04-27 21:41:50 +02:00
RumovZ
4938a30405 Rework apkg note import tests
- Use macros for more helpful errors.
- Split monolith into unit tests.
- Fix some unknown error with the previous test along the way.
(Was failing after 969484de4388d225c9f17d94534b3ba0094c3568.)
2022-04-27 21:25:02 +02:00
RumovZ
b0d97454a8 Truncate logged fields 2022-04-27 18:42:34 +02:00
RumovZ
382d7417a8 Alias [u8; 20] with Sha1Hash 2022-04-27 18:36:11 +02:00
RumovZ
f2988f8054 take_fields() → into_fields() 2022-04-27 18:34:29 +02:00
RumovZ
969484de43 Log conflicting note in remapped nt case 2022-04-27 18:25:12 +02:00
Damien Elmes
a4dfad565d Fix a corner-case where due dates were shifted by a day
This issue existed in the old Python code as well. We need to include
the user's UTC offset in the exported file, or days_elapsed falls back
on the v1 cutoff calculation, which may be a day earlier or later than
the v2 calculation.
2022-04-27 16:27:13 +10:00
Damien Elmes
308c663233 Reset filtered decks at import time
Before this change, filtered decks exported with scheduling remained
filtered on import, and maybe_remove_from_filtered_deck() moved cards
into them as their home deck, leading to errors during review.

We may still want to provide a way to preserve filtered decks on import,
but to do that we'll need to ensure we don't rewrite the home decks of
cards, and we'll need to ensure the home decks are included as part of
the import (or give an error if they're not).

https://github.com/ankitects/anki/pull/1743/files#r839346423
2022-04-27 14:48:47 +10:00
Damien Elmes
23eda19677 Show progress of note imports
Note import is the slowest part, so showing progress here makes the UI
feel more responsive.
2022-04-27 13:49:04 +10:00
Damien Elmes
d645824098 Update progress after prepare_media() finishes
Otherwise the bulk of the import ends up being shown as "Checked: 0"
in the progress window.
2022-04-27 13:20:28 +10:00
Damien Elmes
c4ebbd719c Avoid an extra allocation when extracting media checksums 2022-04-27 11:39:51 +10:00
Damien Elmes
c7c1cfac33 Stop after one test failure
mypy often fails much faster than pylint
2022-04-27 09:30:49 +10:00
Damien Elmes
284805f095 Avoid re-exporting protobuf msgs we only use internally 2022-04-27 09:29:38 +10:00
Damien Elmes
0e9a8e18c1 Avoid kwargs in pb message creation, so typechecking is not lost
Protobuf's behaviour is rather subtle and I had to dig through the docs
to figure it out: set a field on a submessage to automatically assign 
the submessage to the parent, or call SetInParent() to persist a default
version of the field you specified.
2022-04-26 22:01:00 +10:00
Damien Elmes
070d3045eb Add symlink for typechecking of import_export_pb2 2022-04-26 21:37:49 +10:00
Damien Elmes
8204ceece1 Remove unused import in proto file 2022-04-26 21:30:48 +10:00
Damien Elmes
055b404165 Add legacy arg to ExportAnkiPackage
Currently not exposed on the frontend
2022-04-26 21:30:47 +10:00
Damien Elmes
ede9698aea Handle zstd-compressed apkg 2022-04-26 21:30:28 +10:00
RumovZ
766396809d Open transaction in insert_data()
Was slowing down exporting by several orders of magnitude.
2022-04-25 09:50:37 +02:00
RumovZ
98d87fd36a Expose new apkg and colpkg exporting 2022-04-25 08:32:38 +02:00
RumovZ
c237d4c969 Add QueryOpWithBackendProgress
Also support backend exporting progress.
2022-04-25 08:32:17 +02:00
RumovZ
4137b1e6e6 Fix exception printing for QueryOp as well 2022-04-25 08:31:15 +02:00
RumovZ
266362b917 Return number of notes imported from apkg 2022-04-25 08:29:01 +02:00
RumovZ
e4d36e71f3 Make apkg exporting on backend abortable 2022-04-25 08:28:26 +02:00
RumovZ
e6dbe5b7f8 Fix all_checksums() for media import
Entries of deleted files are nulled, not removed.
2022-04-25 08:24:11 +02:00
RumovZ
c316996a23 Conditionally enable new importing in GUI 2022-04-22 21:25:18 +02:00
RumovZ
8c1a4d0cdd Update progress when checking incoming media too 2022-04-22 21:22:56 +02:00
RumovZ
6eb8aa0987 Add note ids to log and strip HTML 2022-04-22 19:01:17 +02:00
RumovZ
50c8267c15 Add ClosedCollectionOp 2022-04-22 16:54:02 +02:00
RumovZ
2491b966b5 Fix wrong Interrupted Exception being checked 2022-04-22 16:48:59 +02:00
RumovZ
2acad4504e Add CollectionOpWithBackendProgress 2022-04-22 09:32:56 +02:00
RumovZ
4837e52fe9 Merge branch 'main' into apkg 2022-04-22 08:39:10 +02:00
Damien Elmes
ee70006ec4 Reset zoom on page transition
https://forums.ankiweb.net/t/2-1-50-zooming-in-while-reviewing-results-in-an-unusably-huge-deck-list/19283
2022-04-22 15:45:50 +10:00
RumovZ
aea7eb667e
Fix progress of chained operations (#1817)
* Fix progress of chained operations

Especially aborting colpkg import.

* Notify about missing progress dialog
2022-04-22 14:47:17 +10:00
Matthias Metelka
2b739d76b2
Align list items to start (#1816) 2022-04-22 14:18:11 +10:00
Matthias Metelka
770fabd51b
Remove unnecessary night mode rule for typeans (#1815)
which caused https://forums.ankiweb.net/t/shaddow-below-cloze-type-area-in-night-mode/19287/2
2022-04-22 14:17:43 +10:00
Damien Elmes
280c06425d Increase compression on zstd packages 2022-04-22 13:52:24 +10:00
RumovZ
592e7e240c Fix archived collection name on apkg import 2022-04-21 09:03:10 +02:00
Damien Elmes
e6d990a44e Fix cwd changing on export
No longer required after #1656
2022-04-21 16:50:05 +10:00
Abdo
6ea75df292
Fix pasting of local links to unsupported types that contain spaces (#1813)
This change causes local links to unsupported formats like PDF to be
handled by _processUrls() instead of _processText, converting them to
correct hyperlinks in case they contain spaces.
2022-04-21 14:10:53 +10:00
Damien Elmes
6f764aeda4 Fix custom browser font not being honored
https://forums.ankiweb.net/t/on-anki-2-1-50-browser-table-font-override-is-not-respected/19259
2022-04-21 13:28:22 +10:00
RumovZ
bf5254e882 Merge remote-tracking branch 'upstream/HEAD' into apkg 2022-04-20 20:52:02 +02:00
RumovZ
63ad6624a6 Return note log when importing apkg 2022-04-20 20:48:22 +02:00
RumovZ
6b85b5900f Expose apkg export/import on backend 2022-04-20 16:01:34 +02:00
Damien Elmes
ef51bcefd6 Bump bazel version
Closes #1808
2022-04-20 21:53:59 +10:00
Damien Elmes
031fc625fd Update Mac build to Qt 6.3 2022-04-20 21:33:31 +10:00
Damien Elmes
30d55aa553 Only require ANKI_WAYLAND if frozen
Accidentally changed `and` to `or` while testing 7115caab13.
2022-04-20 19:41:41 +10:00
Damien Elmes
0b03919f45 Upgrade to Qt 6.3
Fixes #1753
Fixes #1770
2022-04-20 19:12:10 +10:00
Damien Elmes
ff9aed91de Update translations 2022-04-20 19:12:10 +10:00