Anki is a smart spaced repetition flashcard program
Find a file
Damien Elmes c2e8d89fc6
Colpkg fixes (#1722)
* Fix legacy colpkg import; disable v3 import/export; add roundtrip test

The test has revealed we weren't decompressing the media files on v3
import. That's easy to fix, but means all files need decompressing
even when they already exist, which is not ideal - it would be better
to store size/checksum in the metadata instead.

* Switch media and meta to protobuf; re-enable v3 import/export

- Fixed media not being decompressed on import
- The uncompressed size and checksum is now included for each media
entry, so that we can quickly check if a given file needs to be extracted.
We're still just doing a naive size comparison on colpkg import at the
moment, but we may want to use a checksum in the future, and will need
a checksum for apkg imports.
- Checksums can't be efficiently encoded in JSON, so the media list
has been switched to protobuf to reduce the the space requirements.
- The meta file has been switched to protobuf as well, for consistency.
This will mean any colpkg files exported with beta7 will be
unreadable.

* Avoid integer version comparisons

* Re-enable v3 test

* Apply suggestions from code review

Co-authored-by: RumovZ <gp5glkw78@relay.firefox.com>

* Add export_colpkg() method to Collection

More discoverable, and easier to call from unit tests

* Split import/export code out into separate folders

Currently colpkg/*.rs contain some routines that will be useful for
apkg import/export as well; in the future we can refactor them into a
separate file in the parent module.

* Return a proper error when media import fails

This tripped me up when writing the earlier unit test - I had called
the equivalent of import_colpkg()?, and it was returning a string error
that I didn't notice. In practice this should result in the same text
being shown in the UI, but just skips the tooltip.

* Automatically create media folder on import

* Move roundtrip test into separate file; check collection too

* Remove zstd version suffix

Prevents a warning shown each time Rust Analyzer is used to check the
code.

Co-authored-by: RumovZ <gp5glkw78@relay.firefox.com>
2022-03-17 15:11:23 +10:00
.buildkite Make build step optional in Linux docker containers 2022-03-09 18:20:13 +10:00
.github/ISSUE_TEMPLATE update bug report template 2021-11-12 12:20:02 +10:00
.vscode Don't warn about missing .py files in VS Code 2022-03-07 11:54:41 +10:00
cargo Update Rust deps 2022-03-15 16:51:52 +10:00
docs Automatically clean up stale files on TS build error 2022-02-25 12:25:55 +10:00
ftl Backend colpkg exporting (#1719) 2022-03-15 16:48:02 +10:00
platforms use x86 binaries for clang format/protobuf on Mac 2021-10-16 18:07:39 +10:00
proto Colpkg fixes (#1722) 2022-03-17 15:11:23 +10:00
pylib Colpkg fixes (#1722) 2022-03-17 15:11:23 +10:00
python Update Python deps, including stable Black 2022-02-25 15:26:16 +10:00
qt Colpkg fixes (#1722) 2022-03-17 15:11:23 +10:00
rslib Colpkg fixes (#1722) 2022-03-17 15:11:23 +10:00
sass Fix bury count (more) (#1712) 2022-03-07 11:03:14 +10:00
tools Automatically clean up stale files on TS build error 2022-02-25 12:25:55 +10:00
ts Fix add-on usages of addMedia (#1721) 2022-03-16 10:29:06 +10:00
.bazelignore updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.bazelrc updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.bazelversion updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.prettierignore Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
.prettierrc Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
.user.bazelrc move Bazel convenience symlinks outside of repo folder 2022-01-23 19:18:44 +10:00
BUILD.bazel updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
Cargo.lock Update Rust deps 2022-03-15 16:51:52 +10:00
Cargo.toml updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
CONTRIBUTORS Extend maximum answer time... (#1698) 2022-03-15 10:06:45 +10:00
defs.bzl Update to latest rules_rust, which unblocks the tokio upgrade 2022-03-03 19:48:17 +10:00
late_deps.bzl download wheels using rules_python 2021-10-15 16:02:26 +10:00
LICENSE move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
package.json Update prettier-plugin-svelte (#1711) 2022-03-05 14:27:47 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
pyrightconfig.json updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
README.md fix build badge 2021-06-24 09:21:56 +10:00
repos.bzl Update translations 2022-03-15 16:52:15 +10:00
run get PyQt working directly with ./run on macOS 2021-10-16 18:07:29 +10:00
run.bat updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
SECURITY.md add SECURITY.md 2021-09-22 22:55:19 +10:00
WORKSPACE move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
yarn.lock Update prettier-plugin-svelte (#1711) 2022-03-05 14:27:47 +10:00

Anki

Build status

This repo contains the source code for the computer version of Anki.

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see https://betas.ankiweb.net/

For more information on building, please see Development.