Skip to content

Commit af47c6d

Browse files
hherbclaude
andcommitted
Don't stop discovery early when verification is enabled
When verify_content=True, we need fallback sources in case the first OA source fails verification (e.g., PMC has wrong PDF associated with a PMCID). Now discovery continues to find all sources (like Unpaywall) so they can be tried when PMC fails. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7958e20 commit af47c6d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/bmlibrarian/discovery/full_text_finder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,13 @@ def discover_and_download(
224224
if progress_callback:
225225
progress_callback("discovery", "starting")
226226

227+
# When verification is enabled, don't stop on first OA - we need fallback sources
228+
# in case the first source fails verification (e.g., PMC has wrong PDF)
229+
stop_early = self.prefer_open_access and not verify_content
230+
227231
discovery = self.discover(
228232
identifiers,
229-
stop_on_first_oa=self.prefer_open_access,
233+
stop_on_first_oa=stop_early,
230234
progress_callback=progress_callback
231235
)
232236

0 commit comments

Comments
 (0)