api enable
This commit is contained in:
+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