feat(archive): import a studyset with everything in it and its progress

Your call (2026-10-11): an archive, imported from the Library's Import, to
bring a library from elsewhere as one's own, and later to restore backups
and move studysets between instances before federation.

An archive is a .zip: archive.json says its format; the studyset is laid
out as a release (ADR 0005, rule 3), so the release copier writes it, now
also unlinked from any publication (ReleaseCopier.write), its cards marked
"archive" as imported ones are, handing back each item's new id. A card may
name a dictionary entry instead of its payload: the import makes it from
the instance's dictionary as adding from it does, with today's entry,
examples and tags, and leaves out (counting) one the instance lacks; for
that, DictionaryEndpoint.entries gives entries by their ids, at most 1,000
at once. reviews.json lists reviews of the archive's cards; they go into
the person's review log once the cards are in, so every card's schedule
goes on from them.

The sheet says what the archive holds ("Japanese" holds: 12 studysets,
7,745 flashcards, 3 paths, 20,317 reviews), imports once confirmed, busy
meanwhile, and opens the studyset made. Not an archive, a newer format or
an unreadable one says so and imports nothing. No export into the format
yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-11 16:39:07 +02:00
commit ff31652a3a
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 1548 additions and 37 deletions

View file

@ -373,6 +373,25 @@ class EndpointDictionary extends _isc.EndpointRef {
'versions': versions,
},
);
/// The entries of the dictionary of [source] with meanings in
/// [glossLanguage] by their ids ([sourceIds], at most [maxCompared]), in
/// the order named: for cards an archive names by their entry, made as
/// they would be from the dictionary. An entry gone from the source isn't
/// among them.
_ida.Future<List<_iqbqiphu.DictionaryHit>> entries(
String source,
String glossLanguage,
List<String> sourceIds,
) => caller.callServerEndpoint<List<_iqbqiphu.DictionaryHit>>(
'dictionary',
'entries',
{
'source': source,
'glossLanguage': glossLanguage,
'sourceIds': sourceIds,
},
);
}
/// Explore (ADR 0005, rule 4): the studysets published on this instance,

View file

@ -2668,6 +2668,9 @@ class Protocol extends _isd.DatabaseSerializationManager {
)
as T;
}
if (t == List<String>) {
return (data as List).map((e) => deserialize<String>(e)).toList() as T;
}
if (t == List<_iyigb6vc.ExploreEntry>) {
return (data as List)
.map((e) => deserialize<_iyigb6vc.ExploreEntry>(e))
@ -2684,9 +2687,6 @@ class Protocol extends _isd.DatabaseSerializationManager {
.toList()
as T;
}
if (t == List<String>) {
return (data as List).map((e) => deserialize<String>(e)).toList() as T;
}
try {
return _iaic.Protocol().deserialize<T>(data, t);
} on _isc.DeserializationTypeNotFoundException catch (_) {}