From fb9bb603b9c4ddd580fc2f0312a19d1b37c6381c Mon Sep 17 00:00:00 2001 From: Victor Kataev Date: Fri, 2 Oct 2026 17:35:43 +0000 Subject: [PATCH] fix: mark author feed links as subsections - Add the subsection relationship to author navigation links. - Verify all author links retain the acquisition feed type and open their book listing. --- src/opds_server/services/opds.py | 2 +- tests/test_catalog_endpoints.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/opds_server/services/opds.py b/src/opds_server/services/opds.py index 8f6f864..1bffd44 100644 --- a/src/opds_server/services/opds.py +++ b/src/opds_server/services/opds.py @@ -281,7 +281,7 @@ async def generate_by_author_feed(page: int, config: Config) -> str: author={"name": "Calibre OPDS Server"}, updated_time=updated_time, links=( - f'' ), ) diff --git a/tests/test_catalog_endpoints.py b/tests/test_catalog_endpoints.py index dafce7a..52d00c2 100644 --- a/tests/test_catalog_endpoints.py +++ b/tests/test_catalog_endpoints.py @@ -274,7 +274,13 @@ def test_author_navigation_detail_and_authorless_books(catalog_client): readable.""" _, client = catalog_client author_feed = parse_atom(client.get("/opds/by-author")) - detail_href = entries(author_feed)[0].find("atom:link", NS).get("href") + for entry in entries(author_feed): + author_links = links(entry, "subsection") + assert len(author_links) == 1 + assert author_links[0].get("type") == ( + "application/atom+xml;profile=opds-catalog;kind=acquisition" + ) + detail_href = links(entries(author_feed)[0], "subsection")[0].get("href") detail = parse_atom(client.get(detail_href)) assert detail.findtext("atom:title", namespaces=NS) == "Books by Ada & Sons" assert {