Content-Length: 1116 | pFad | http://github.com/internetarchive/openlibrary/commit/8e106b227de2d4b30abb4baa03f9e65281bafc67.patch
99
From e89362ba6a8d303b410bb76067e1b2d659bdb169 Mon Sep 17 00:00:00 2001
From: RayBB
Date: Tue, 23 Apr 2024 18:18:16 +0200
Subject: [PATCH] improved is_loaned_out logic
---
openlibrary/core/lending.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openlibrary/core/lending.py b/openlibrary/core/lending.py
index 65ece717d7c..0ba3c0bd470 100644
--- a/openlibrary/core/lending.py
+++ b/openlibrary/core/lending.py
@@ -551,7 +551,7 @@ def is_loaned_out(identifier: str) -> bool:
return (
is_loaned_out_on_ol(identifier)
or is_loaned_out_on_acs4(identifier)
- or is_loaned_out_on_ia(identifier)
+ or (is_loaned_out_on_ia(identifier) is True)
)
@@ -561,7 +561,7 @@ def is_loaned_out_on_acs4(identifier: str) -> bool:
return item.has_loan()
-def is_loaned_out_on_ia(identifier: str):
+def is_loaned_out_on_ia(identifier: str) -> bool | None:
"""Returns True if the item is checked out on Internet Archive."""
url = "https://archive.org/services/borrow/%s?action=status" % identifier
try:
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/internetarchive/openlibrary/commit/8e106b227de2d4b30abb4baa03f9e65281bafc67.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy