From 9391d2ce0179e7e74b228c431366a7fefa19a4c8 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 10 Sep 2025 22:29:17 -0400 Subject: [PATCH] Modify URI in create_collection3 to conditionally include page --- iiify/resolver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiify/resolver.py b/iiify/resolver.py index 55eae7c3..0f87ed09 100644 --- a/iiify/resolver.py +++ b/iiify/resolver.py @@ -165,8 +165,8 @@ def create_collection3(identifier, domain, page=1, rows=MAX_API_LIMIT): # Get item metadata metadata = requests.get('%s/metadata/%s' % (ARCHIVE, identifier)).json() - # Used to build up URIs for the manifest - uri = f"{domain}{identifier}/collection.json" + # Write Collection uri with conditional page segment + uri = f"{domain}{identifier}{f'/{page}' if page != 1 else ''}/collection.json" config.configs['helpers.auto_fields.AutoLang'].auto_lang = "none" collection = Collection(id=uri, label=metadata["metadata"]["title"])