summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/transforms/elasticsearch.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@archive.org>2020-07-24 02:56:13 +0000
committerbnewbold <bnewbold@archive.org>2020-07-24 02:56:13 +0000
commit2170e5ff46dfb2bba9bf26196de3c3774c16cd4a (patch)
treee78de45cbca526dfacf7ae9ada31152a790fa0a4 /python/fatcat_tools/transforms/elasticsearch.py
parent6a87b3d2e1b315d35ccaa13457571d73afaf5e6b (diff)
parent3e5799e0bb3f0eb7b9f5d690692757cfbf400412 (diff)
downloadfatcat-2170e5ff46dfb2bba9bf26196de3c3774c16cd4a.tar.gz
fatcat-2170e5ff46dfb2bba9bf26196de3c3774c16cd4a.zip
Merge branch 'bnewbold-preservation-year-offset' into 'master'
preservation year offset See merge request webgroup/fatcat!67
Diffstat (limited to 'python/fatcat_tools/transforms/elasticsearch.py')
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index 8ec9c164..2eb18fbf 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -1,4 +1,6 @@
+import datetime
+
import tldextract
@@ -114,6 +116,7 @@ def release_to_elasticsearch(entity, force_bool=True):
# TODO: mapping... probably by lookup?
t['affiliation_rors'] = None
+ this_year = datetime.date.today().year
container = release.container
if container:
t['publisher'] = container.publisher
@@ -130,6 +133,12 @@ def release_to_elasticsearch(entity, force_bool=True):
in_kbart = in_jstor
for archive in ('portico', 'lockss', 'clockss'):
in_kbart = in_kbart or check_kbart(release_year, c_extra['kbart'].get(archive))
+ # recent KBART coverage is often not updated for the
+ # current year. So for current-year publications, consider
+ # coverage from *last* year to also be included in the
+ # Keeper
+ if not in_kbart and release_year == this_year:
+ in_kbart = check_kbart(this_year - 1, c_extra['kbart'].get(archive))
if c_extra.get('ia'):
if c_extra['ia'].get('sim') and release_year: