api enable
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ services:
|
||||
# Grimmory bookdrop — set the host path to Grimmory's bookdrop directory
|
||||
- /path/to/grimmory/bookdrop:/bookdrop
|
||||
# Local import folder — set the host path to your epub/pdf directory
|
||||
- /path/to/local-books:/local-books
|
||||
- /path/to/local-books:/local_books
|
||||
# Optional: mount your SSH private key read-only instead of pasting it in the UI
|
||||
# - ~/.ssh/id_rsa:/run/secrets/ssh_key:ro
|
||||
restart: unless-stopped
|
||||
|
||||
+3
-3
@@ -21,16 +21,16 @@ def _is_in_grimmory(filename: str, url: str, user: str, password: str) -> bool:
|
||||
stem = Path(filename).stem
|
||||
try:
|
||||
r = requests.get(
|
||||
url.rstrip("/") + "/komga/api/v1/books",
|
||||
url.rstrip("/") + "/api/v1/books",
|
||||
params={"search": stem},
|
||||
auth=(user, password),
|
||||
timeout=10,
|
||||
)
|
||||
if r.status_code == 200:
|
||||
return r.json().get("totalElements", 0) > 0
|
||||
log.warning("Grimmory search returned HTTP %s for '%s'", r.status_code, stem)
|
||||
log.debug("Grimmory search returned HTTP %s for '%s' — skipping API check", r.status_code, stem)
|
||||
except Exception as e:
|
||||
log.warning("Grimmory duplicate check failed for '%s': %s", filename, e)
|
||||
log.debug("Grimmory duplicate check unavailable for '%s': %s", filename, e)
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user