Skip to content

Commit 57068ab

Browse files
authored
Merge pull request #14 from cdrini/refactor/rename-some-params
Rename some parameters
2 parents ceb0ea1 + a1f32dc commit 57068ab

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

opds2/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ def create(
190190
metadata.currentPage = search.page
191191

192192
base_url = provider.SEARCH_URL.replace("{?query}", "")
193+
if base_url.startswith("/"):
194+
base_url = provider.BASE_URL.rstrip('/') + base_url
195+
193196
self_url = base_url + ("?" + urlencode(params) if params else "")
194197
links.append(
195198
Link(

opds2/provider.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ def search(self, query: str, limit: int = 50, offset: int = 0) -> List[Publicati
9191
"""
9292

9393
TITLE: str = "Generic OPDS Service"
94-
URL: str = "http://localhost/"
95-
CATALOG_URL: str = "/opds/catalog"
94+
95+
BASE_URL: str = "http://localhost"
96+
"""The base url for the data provider."""
97+
9698
SEARCH_URL: str = "/opds/search{?query}"
99+
"""The relative url template for search queries."""
97100

98101
@staticmethod
99102
@abstractmethod

0 commit comments

Comments
 (0)