add missing comics endpoints
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
2026-05-19 23:00:19 +02:00
parent 6077f685e0
commit d23d1f306a
7 changed files with 306 additions and 37 deletions
+7 -6
View File
@@ -27,6 +27,7 @@ MAPPING: Dict[str, str] = {
"volume": "api/comics/volumes",
"story_arc": "api/comics/storyarcs",
"issue": "api/comics/issues",
"comic_work": "api/comics/comicworks",
"issue_work": "api/comics/issueworks",
"article": "api/bookshelf/articles",
"bookshelf_publisher": "api/bookshelf/publishers",
@@ -46,13 +47,15 @@ MAPPING: Dict[str, str] = {
"mail_account": "api/admin/mailaccounts",
}
class EndPointNotAvailableException(Exception):
"""
Raised when calling an not existing endpoint.
"""
pass
@dataclass
class Login:
"""
@@ -106,7 +109,7 @@ class Server:
headers: Dict[str, str] = {"Authorization": f"Bearer {self.token}"}
response = requests.get(url, headers=headers, timeout=self.timeout)
log.debug(f"Status: {response.status_code}")
if response.status_code==404:
if response.status_code == 404:
raise EndPointNotAvailableException
data = response.json()
return data
@@ -129,16 +132,14 @@ class ApiConfig:
login: Login
server: List[Server]
def get_server(self, server_name: str) -> Optional[Server]:
"""
"""
""" """
found_server = None
for server in self.server:
if server.name == server_name:
found_server = server
return found_server
def get_logger(level, config: str):