From bd25522d6db55431cd067e30b4499f44cff4620d Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 21 Oct 2024 18:46:05 -0400 Subject: [PATCH] add openlibrary switch --- core/bookloader.py | 2 ++ settings/common.py | 1 + 2 files changed, 3 insertions(+) diff --git a/core/bookloader.py b/core/bookloader.py index 0b958bbc..08644fa6 100755 --- a/core/bookloader.py +++ b/core/bookloader.py @@ -673,6 +673,8 @@ def despam_description(description): return description.replace('\r\n', '\n') def add_openlibrary(work, hard_refresh=False): + if not settings.USE_OPENLIBRARY and not settings.DEBUG: + return if (not hard_refresh) and work.openlibrary_lookup is not None: # don't hit OL if we've visited in the past month or so if now()- work.openlibrary_lookup < timedelta(days=90): diff --git a/settings/common.py b/settings/common.py index b28dae88..c9989cda 100644 --- a/settings/common.py +++ b/settings/common.py @@ -514,6 +514,7 @@ BOOXTREAM_TEST_EPUB_URL = 'https://github.com/Gluejar/open_access_ebooks_ebook/r TEST_PDF_URL = "https://github.com/Gluejar/flatland/raw/master/downloads/Flatland.pdf" FILE_UPLOAD_MAX_MEMORY_SIZE = 20971520 #20MB +USE_OPENLIBRARY = False # Selenium related -- set if Se tests run FIREFOX_PATH = ''