Skip to content

Commit

Permalink
Merge pull request #58 from kba/refresh-caches-on-reorder
Browse files Browse the repository at this point in the history
Document.reorder: invalidate OcrdMets cache before save
  • Loading branch information
hnesk authored Feb 20, 2023
2 parents 3e30fa7 + 3015bc6 commit 0ce2772
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ codespell: deps-dev

test: tests/assets deps-dev
$(PYTHON) -m xmlrunner discover -v -s tests --output-file $(CURDIR)/unittest.xml
OCRD_METS_CACHING=true $(PYTHON) -m xmlrunner discover -v -s tests --output-file $(CURDIR)/unittest.xml

ci: flake8 mypy test codespell

Expand Down
1 change: 1 addition & 0 deletions ocrd_browser/model/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def reorder(self, ordered_page_ids: List[str]) -> None:
page_sequence.append(div)

old_to_new = dict(zip(old_page_ids, self.page_ids))
self.workspace.mets.refresh_caches()
self.save_mets()
self._emit('document_changed', 'reordered', old_to_new)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ocrd
ocrd >= 2.43.0
Pillow
numpy >= 1.20
opencv-python-headless
Expand Down

0 comments on commit 0ce2772

Please sign in to comment.