From 673918771cb9ab94f592a58a50a84f9a227eb00e Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 21 Jan 2024 16:36:52 +0900 Subject: [PATCH] =?UTF-8?q?XmlMeta=E3=82=92=E6=AD=A3=E5=B8=B8=E3=81=AB?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/scanner/ScannerManagerActivity.java | 10 +++++----- .../java/one/nem/lacerta/data/impl/DocumentImpl.java | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java index 3603ff12..02f935e2 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java @@ -164,10 +164,10 @@ public class ScannerManagerActivity extends AppCompatActivity { document.createDocument(documentMeta).thenAccept((documentDetail1) -> { Bitmap[] bitmaps = new Bitmap[this.croppedImages.size()]; this.croppedImages.toArray(bitmaps); - addPagesToDocumentDetail(documentDetail1, bitmaps).thenRun(() -> { - dialog.dismiss(); - finish(); - }); + addPagesToDocumentDetail(documentDetail1, bitmaps).join(); + document.updateDocument(documentDetail1).join(); + dialog.dismiss(); + finish(); }); } @@ -175,7 +175,7 @@ public class ScannerManagerActivity extends AppCompatActivity { private CompletableFuture addPagesToDocumentDetail(DocumentDetail documentDetail, Bitmap[] bitmaps) { return CompletableFuture.runAsync(() -> { try { - documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps); + document.updateDocument(documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps).getDocumentDetail()).join(); lacertaVcsFactory.create(documentDetail.getMeta().getId()).generateRevisionAtCurrent("Initial commit"); } catch (Exception e) { logger.error(TAG, "Error: " + e.getMessage()); diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java index 8898731a..87776426 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java @@ -119,6 +119,7 @@ public class DocumentImpl implements Document { @Override public CompletableFuture updateDocument(DocumentDetail detail) { return CompletableFuture.supplyAsync(() -> { + updateXmlMeta(detail).join(); return null; }); }