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,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<Void> 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());

View File

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