summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-29 17:11:18 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-29 17:11:18 -0700
commitc8f932a7335a89dcf6e505b04d9c3636718074ab (patch)
treeeb5ac5371bbf8b66c2b5ff2308683d312f958de8
parentc4f5ba60cf3581dc58875a4e56f8964560496753 (diff)
downloadfatcat-scholar-c8f932a7335a89dcf6e505b04d9c3636718074ab.tar.gz
fatcat-scholar-c8f932a7335a89dcf6e505b04d9c3636718074ab.zip
remove old COVID19 thumbnail hack
-rw-r--r--fatcat_scholar/templates/search_macros.html1
-rw-r--r--fatcat_scholar/transform.py3
-rw-r--r--settings.toml2
3 files changed, 3 insertions, 3 deletions
diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html
index ebc6a94..69e2636 100644
--- a/fatcat_scholar/templates/search_macros.html
+++ b/fatcat_scholar/templates/search_macros.html
@@ -178,7 +178,6 @@
</div>
<div class="three wide left aligned column" style="padding-top: 0.5em; padding-right: 0.5em;">
{% if paper.fulltext.access_url %}
- {# <img src="{{ settings.COVID19_FULLTEXT_HOST }}{{ paper.fulltext.thumbnail_url }}" style="border: 1px solid grey; max-height: 12em; max-width: 100%;"> #}
{% if paper.fulltext.thumbnail_url %}
<div class="ui card" style="margin-bottom: 0.2em;">
<a class="image" target="_blank" href="{{ paper.fulltext.access_url}}">
diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py
index 7e7ef56..5bedfd7 100644
--- a/fatcat_scholar/transform.py
+++ b/fatcat_scholar/transform.py
@@ -2,6 +2,7 @@ import sys
import argparse
from typing import List, Dict, Optional, Any, Sequence
+from dynaconf import settings
from fatcat_openapi_client import ReleaseEntity, FileEntity
from fatcat_scholar.api_entities import *
@@ -152,7 +153,7 @@ def _add_file_release_meta(
fulltext.access_type = best_url_type
if pdf_meta is not None and pdf_meta.get("has_page0_thumbnail"):
# eg: https://blobs.fatcat.wiki/thumbnail/pdf/32/29/322909fe57cef73b10a166996a4528d337026d16.180px.jpg
- fulltext.thumbnail_url = f"https://blobs.fatcat.wiki/thumbnail/pdf/{ fe.sha1[0:2] }/{ fe.sha1[2:4] }/{ fe.sha1 }.180px.jpg"
+ fulltext.thumbnail_url = f"{ settings.THUMBNAIL_URL_PREFIX }{ fe.sha1[0:2] }/{ fe.sha1[2:4] }/{ fe.sha1 }.180px.jpg"
return fulltext
diff --git a/settings.toml b/settings.toml
index baa7580..ca751b6 100644
--- a/settings.toml
+++ b/settings.toml
@@ -5,7 +5,7 @@ SCHOLAR_DOMAIN = "fatcat.wiki"
I18N_LANG_DEFAULT = "en"
ELASTICSEARCH_BACKEND = "https://search.fatcat.wiki"
ELASTICSEARCH_FULLTEXT_INDEX = "scholar_fulltext"
-COVID19_FULLTEXT_HOST = "https://covid19.fatcat.wiki"
+THUMBNAIL_URL_PREFIX = "https://blobs.fatcat.wiki/thumbnail/pdf/"
[dev]
SCHOLAR_ENV = "dev"