Merge pull request #1061 from Gluejar/maintenance-2024

add openlibrary switch
pull/94/head
Eric Hellman 2024-10-21 18:46:28 -04:00 committed by GitHub
commit ce8d81397c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -673,6 +673,8 @@ def despam_description(description):
return description.replace('\r\n', '\n') return description.replace('\r\n', '\n')
def add_openlibrary(work, hard_refresh=False): 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: 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 # don't hit OL if we've visited in the past month or so
if now()- work.openlibrary_lookup < timedelta(days=90): if now()- work.openlibrary_lookup < timedelta(days=90):

View File

@ -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" TEST_PDF_URL = "https://github.com/Gluejar/flatland/raw/master/downloads/Flatland.pdf"
FILE_UPLOAD_MAX_MEMORY_SIZE = 20971520 #20MB FILE_UPLOAD_MAX_MEMORY_SIZE = 20971520 #20MB
USE_OPENLIBRARY = False
# Selenium related -- set if Se tests run # Selenium related -- set if Se tests run
FIREFOX_PATH = '' FIREFOX_PATH = ''