XmlMetaを正常に更新できるようにした

This commit is contained in:
r-ca 2024-01-21 16:36:52 +09:00
parent df14850df1
commit 673918771c
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 6 additions and 5 deletions

View File

@ -164,18 +164,18 @@ public class ScannerManagerActivity extends AppCompatActivity {
document.createDocument(documentMeta).thenAccept((documentDetail1) -> { document.createDocument(documentMeta).thenAccept((documentDetail1) -> {
Bitmap[] bitmaps = new Bitmap[this.croppedImages.size()]; Bitmap[] bitmaps = new Bitmap[this.croppedImages.size()];
this.croppedImages.toArray(bitmaps); this.croppedImages.toArray(bitmaps);
addPagesToDocumentDetail(documentDetail1, bitmaps).thenRun(() -> { addPagesToDocumentDetail(documentDetail1, bitmaps).join();
document.updateDocument(documentDetail1).join();
dialog.dismiss(); dialog.dismiss();
finish(); finish();
}); });
});
} }
private CompletableFuture<Void> addPagesToDocumentDetail(DocumentDetail documentDetail, Bitmap[] bitmaps) { private CompletableFuture<Void> addPagesToDocumentDetail(DocumentDetail documentDetail, Bitmap[] bitmaps) {
return CompletableFuture.runAsync(() -> { return CompletableFuture.runAsync(() -> {
try { try {
documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps); document.updateDocument(documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps).getDocumentDetail()).join();
lacertaVcsFactory.create(documentDetail.getMeta().getId()).generateRevisionAtCurrent("Initial commit"); lacertaVcsFactory.create(documentDetail.getMeta().getId()).generateRevisionAtCurrent("Initial commit");
} catch (Exception e) { } catch (Exception e) {
logger.error(TAG, "Error: " + e.getMessage()); logger.error(TAG, "Error: " + e.getMessage());

View File

@ -119,6 +119,7 @@ public class DocumentImpl implements Document {
@Override @Override
public CompletableFuture<Void> updateDocument(DocumentDetail detail) { public CompletableFuture<Void> updateDocument(DocumentDetail detail) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
updateXmlMeta(detail).join();
return null; return null;
}); });
} }