Anki/proto/anki
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
..
backend.proto Backups (#1685) 2022-03-07 15:11:31 +10:00
card_rendering.proto replace the old stripHTML() methods with the backend implementation 2021-10-01 23:15:45 +10:00
cards.proto Switch card.original_position to a proto3 optional 2022-03-10 20:48:26 +10:00
collection.proto Backend colpkg exporting (#1719) 2022-03-15 16:48:02 +10:00
config.proto Optionally restore original position and reset counts when forgetting (#1714) 2022-03-09 16:51:41 +10:00
deckconfig.proto Config for burying interday learning cards (#1680) 2022-02-22 21:37:59 +10:00
decks.proto Remove top_deck_id arg in deck_tree() (#1702) 2022-03-02 15:30:32 +10:00
generic.proto Card info cleanup (#1446) 2021-10-23 11:00:43 +10:00
i18n.proto refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
links.proto Disable full screen on Windows with OpenGL (#1715) 2022-03-09 14:21:54 +10:00
media.proto split out remaining tags, stats, media and rendering 2021-07-10 23:16:18 +10:00
notes.proto support updating multiple notes in one transaction/undo op 2021-08-02 17:07:26 +10:00
notetypes.proto Change Notetype UI Rework (#1499) 2021-11-24 12:09:55 +10:00
scheduler.proto Move custom study tag and limit gathering+saving into the backend 2022-03-10 16:23:03 +10:00
search.proto fix sort order toggling 2021-10-30 09:14:43 +10:00
stats.proto Add support for proto3 optional scalars 2022-02-27 19:42:06 +10:00
sync.proto split out sync, search, scheduler & config 2021-07-10 21:33:12 +10:00
tags.proto bikeshedding: amount -> match_limit 2021-09-12 11:57:49 +10:00