mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-21 05:01:26 -07:00
feat(hachidori): send character dictionaries over the link to Hachidori hosts
Hachidori 0.2.3 accepts dictionary ZIPs as chunked upload requests: an unlinked install imports them itself and a linked one forwards them to its host. The parser bridge now imports through that path with replace, retrying a busy commit with the same upload. Linked hosts without linked-import-v1 (hachidori-docker, older Hachidori) keep the management API upload.
This commit is contained in:
11 files changed
+195
-25
No files matched your search
@@ -7,6 +7,7 @@ import {
|
||||
} from './hachidori-dictionary-import';
|
||||
import {
|
||||
buildHachidoriSharingScript,
|
||||
HACHIDORI_LINKED_IMPORT_CAPABILITY,
|
||||
parseHachidoriHostStatus,
|
||||
type HachidoriSharingRequest,
|
||||
} from '../../../shared/hachidori-sharing';
|
||||
@@ -1817,7 +1818,12 @@ export async function importYomitanDictionaryFromZip(
|
||||
const host = await requestHachidoriSharing({ type: 'hd_sharing_status' }, deps, logger);
|
||||
if (host.kind === 'disconnected' || host.kind === 'unavailable')
|
||||
throw new Error(host.message);
|
||||
if (host.kind === 'connected') {
|
||||
// Hosts with linked imports take the ZIP over the link like a local import,
|
||||
// below. Older hosts and hachidori-docker need their management API.
|
||||
if (
|
||||
host.kind === 'connected' &&
|
||||
!host.capabilities.includes(HACHIDORI_LINKED_IMPORT_CAPABILITY)
|
||||
) {
|
||||
const origin = resolveHachidoriManagementUrl(
|
||||
host,
|
||||
hachidoriManagementUrl,
|
||||
|
||||
Reference in new issue
Block a user