From 91585a1fa69e37af84481cf79b86a7bf26627dad Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:49:54 -0700 Subject: [PATCH 1/3] Prefer the metadata JSON file over the version JSON file (#7048) --- src/documents/management/commands/document_importer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/documents/management/commands/document_importer.py b/src/documents/management/commands/document_importer.py index 97b73b743..3535e1476 100644 --- a/src/documents/management/commands/document_importer.py +++ b/src/documents/management/commands/document_importer.py @@ -166,10 +166,7 @@ class Command(CryptMixin, BaseCommand): ) return - if version_path.exists(): - with version_path.open() as infile: - self.version = json.load(infile)["version"] - elif metadata_path.exists(): + if metadata_path.exists(): with metadata_path.open() as infile: data = json.load(infile) self.version = data["version"] @@ -179,6 +176,9 @@ class Command(CryptMixin, BaseCommand): ) elif EXPORTER_CRYPTO_SETTINGS_NAME in data: self.load_crypt_params(data) + elif version_path.exists(): + with version_path.open() as infile: + self.version = json.load(infile)["version"] if self.version and self.version != version.__full_version_str__: self.stdout.write( From cccba47bd707c2ed7b3a2599016ada6edc5adcf8 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:22:18 -0700 Subject: [PATCH 2/3] Fix: remove type attribute from object for Safari (#7056) --- .../components/document-detail/document-detail.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index 677596d8f..8486e1816 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -364,7 +364,7 @@ } @else { - + } } @case (ContentRenderType.Text) { From 0f9710dc8fcb9cbb6ca4a79ea16bb597728ad3c1 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:33:01 -0700 Subject: [PATCH 3/3] Fix: index fresh document data after update archive file (#7057) --- src/documents/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/documents/tasks.py b/src/documents/tasks.py index 5dd5c5e0f..f3eb258b8 100644 --- a/src/documents/tasks.py +++ b/src/documents/tasks.py @@ -285,6 +285,10 @@ def update_document_archive_file(document_id): shutil.move(parser.get_archive_path(), document.archive_path) shutil.move(thumbnail, document.thumbnail_path) + document.refresh_from_db() + logger.info( + f"Updating index for document {document_id} ({document.archive_checksum})", + ) with index.open_index_writer() as writer: index.update_document(writer, document)