From 1eb4149c0619fcaf806a5c95017f438acee9143f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 5 Jan 2022 09:03:44 -0800 Subject: move public domain wall to 1926 ('before 1927') --- fatcat_scholar/search.py | 7 ++++--- fatcat_scholar/transform.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py index c49bd98..b99a661 100644 --- a/fatcat_scholar/search.py +++ b/fatcat_scholar/search.py @@ -50,7 +50,7 @@ class FulltextQuery(BaseModel): {"label": gettext("Past Week"), "slug": "past_week"}, {"label": gettext("Past Year"), "slug": "past_year"}, {"label": gettext("Since 2000"), "slug": "since_2000"}, - {"label": gettext("Before 1925"), "slug": "before_1925"}, + {"label": gettext("Before 1927"), "slug": "before_1927"}, ], } type_options: Any = { @@ -198,8 +198,9 @@ def apply_filters(search: Search, query: FulltextQuery) -> Search: elif query.filter_time == "since_2000": this_year = datetime.date.today().year search = search.filter("range", year=dict(gte=2000, lte=this_year)) - elif query.filter_time == "before_1925": - search = search.filter("range", year=dict(lt=1925)) + elif query.filter_time == "before_1925" or query.filter_time == "before_1927": + # 1925 value retained for backwards compatibility in URLs + search = search.filter("range", year=dict(lte=1927)) elif query.filter_time == "all_time" or query.filter_time is None: pass else: diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py index 207c325..027fb47 100644 --- a/fatcat_scholar/transform.py +++ b/fatcat_scholar/transform.py @@ -441,7 +441,7 @@ def check_exclude_web(biblio: ScholarBiblio) -> bool: Returns a flag that fulltext web archive options to a work should not be linked to from web interface """ - if biblio.release_year and biblio.release_year <= 1925: + if biblio.release_year and biblio.release_year <= 1926: return False if ( biblio.container_ident -- cgit v1.2.3