From e7d6d4a6b59f9e012d1f14ea531e63e3f2afe3a6 Mon Sep 17 00:00:00 2001 From: Ben Silverman Date: Mon, 4 Dec 2023 11:50:27 -0500 Subject: [PATCH 1/2] Don't add 1 to canvas position in search results (#945) --- apps/templates/snippets/volume_result.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/templates/snippets/volume_result.html b/apps/templates/snippets/volume_result.html index 46f23dbf..a2b7a9f5 100644 --- a/apps/templates/snippets/volume_result.html +++ b/apps/templates/snippets/volume_result.html @@ -78,7 +78,7 @@

{% for canvas in volume.meta.inner_hits|group_by_canvas %}
- p. {{ canvas.position|add:1 }} + p. {{ canvas.position }} {% if canvas.highlights|length %}
    {% for fragment in canvas.highlights %} From 9339ae2976ac1030e11058d072922faa9aeaf53e Mon Sep 17 00:00:00 2001 From: Ben Silverman Date: Mon, 4 Dec 2023 12:55:21 -0500 Subject: [PATCH 2/2] Start remote ingest enumerate at 1 (#1000) --- apps/ingest/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ingest/models.py b/apps/ingest/models.py index f8d6b3b3..e85168be 100644 --- a/apps/ingest/models.py +++ b/apps/ingest/models.py @@ -452,7 +452,7 @@ def open_metadata(self): def create_canvases(self): # TODO: What if there are multiple sequences? Is that even allowed in IIIF? - for position, sc_canvas in enumerate(self.remote_manifest['sequences'][0]['canvases']): + for position, sc_canvas in enumerate(self.remote_manifest['sequences'][0]['canvases'], start=1): canvas_metadata = None # TODO: we will need some sort of check for IIIF API version, but not # everyone includes a context for each canvas.