Repository navigation
Fix BaseContent.get() ignoring the url property of subclasses - #110
Open
raffaelemancuso wants to merge 1 commit into
Open
raffaelemancuso wants to merge 1 commit into
raffaelemancuso wants to merge 1 commit into
Conversation
get() rebuilt the plain content URL from self.key instead of using self.url, so PDF.get() and TEI.get() fetched the generic work content rather than the .pdf / .grobid-xml variants their url overrides point at. Use self.url so subclasses download what their URL advertises. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BaseContent.get()rebuilds the plain content URL fromself.keyinstead of using theurlproperty:But
PDFandTEIexist precisely to overrideurlwith the.pdf/.grobid-xmlvariants — sowork.pdf.get()andwork.tei.get()(and theirdownload()) silently fetch the generic work content instead of the format they advertise.The existing
test_work_pdf_and_tei_downloaddoesn't catch this because it only asserts the downloaded files are non-empty, which the plain URL satisfies too.Change
One line:
get()now requestsself.url, so each subclass downloads what its URL points at. Verified thatBaseContent/PDF/TEI.get()now request…/works/W1,…/works/W1.pdfand…/works/W1.grobid-xmlrespectively.🤖 Generated with Claude Code