anki/proto
RumovZ e759885734
Backend colpkg exporting (#1719)
* Implement colpkg exporting on backend

* Use exporting logic in backup.rs

* Refactor exporting.rs

* Add backend function to export collection

* Refactor backend/collection.rs

* Use backend for colpkg exporting

* Don't use default zip compression for media

* Add exporting progress

* Refactor media file writing

* Write dummy collections

* Localize dummy collection note

* Minimize dummy db size

* Use `NamedTempFile::new()` instead of `new_in`

* Drop redundant v2 dummy collection

* COLLECTION_VERSION -> PACKAGE_VERSION

* Split `lock_collection()` into two to drop flag

* Expose new colpkg in GUI

* Improve dummy collection message

* Please type checker

* importing-colpkg-too-new -> exporting-...

* Compress the media map in the v3 package (dae)

On collections with lots of media, it can grow into megabytes.

Also return an error in extract_media_file_names(), instead of masking
it as an optional.

* Store media map as a vector in the v3 package (dae)

This compresses better (eg 280kb original, 100kb hashmap, 42kb vec)

In the colpkg import case we don't need random access. When importing
an apkg, we will need to be able to fetch file data for a given media
filename, but the existing map doesn't help us there, as we need
filename->index, not index->filename.

* Ensure folders in the media dir don't break the file mapping (dae)
2022-03-15 16:48:02 +10:00
..
anki Backend colpkg exporting (#1719) 2022-03-15 16:48:02 +10:00
.clang-format move protobuf into separate folder in preparation for multiple files 2021-07-09 21:02:40 +10:00
.top_level refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
BUILD.bazel refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
clang_format.bzl set local=False for python/protoc/clang 2021-11-01 11:38:20 +10:00
format.py move protobuf into separate folder in preparation for multiple files 2021-07-09 21:02:40 +10:00
protobuf.bzl Add support for proto3 optional scalars 2022-02-27 19:42:06 +10:00