From 17e3251b6899db8882cdd2fa89b64c457c19d74a Mon Sep 17 00:00:00 2001 From: briri Date: Mon, 13 May 2024 08:01:33 -0700 Subject: [PATCH] fix for datacite harvester to address scenarios when there is only one year we need to search --- src/lambdas/harvesters/datacite/app.rb | 4 ++++ src/lambdas/harvesters/harvestable_dmps/app.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/src/lambdas/harvesters/datacite/app.rb b/src/lambdas/harvesters/datacite/app.rb index a2afefd4..e8a9ca74 100644 --- a/src/lambdas/harvesters/datacite/app.rb +++ b/src/lambdas/harvesters/datacite/app.rb @@ -174,6 +174,10 @@ def _find_date_range(entries:) current_year = Date.today.year # Create a range of years for our DataCite query. Cut it off at the current year years = years.uniq.sort.reject { |year| year > current_year } + # If there is only one year return it + return years if years.length <= 1 + + # Determine all of the years between the start and end and return them and sort start_year = years.first gap = years.last - years.first years = [years.first] diff --git a/src/lambdas/harvesters/harvestable_dmps/app.rb b/src/lambdas/harvesters/harvestable_dmps/app.rb index 86638424..9f1b03ad 100644 --- a/src/lambdas/harvesters/harvestable_dmps/app.rb +++ b/src/lambdas/harvesters/harvestable_dmps/app.rb @@ -37,6 +37,7 @@ class HarvestableDmps 'doi.org/10.48321/D1DF9DDDAF', # University of California, Riverside + 'doi.org/10.48321/D106FD79D7', 'doi.org/10.48321/D13BEA529C', 'doi.org/10.48321/D14406894e', 'doi.org/10.48321/D145457051',