Add Internet Archive search-query bulk import - #96
Open
dbvisel wants to merge 5 commits into
Open
Conversation
Recognizes archive.org search URLs (e.g. ?query=subject%3A%22X%22) and opens the existing IA import picker to let users choose which search results to import, reusing the IACollection/IAPlaylist picker infrastructure and by-reference item creation.
zmarinov-astea
self-requested a review
August 19, 2026 13:22
- Delete IACollectionList; consolidate into IASearchList, parameterized by a raw query string. IACollection now passes collection:<id> through the same component instead of a near-duplicate sibling. - Always exclude collection-type results (AND NOT mediatype:collection) via a shared excludeIACollections() helper, applied to both the list's query and the count probe - previously missing from the search path entirely. - Merge iaCollectionFactory and iaSearchCollectionFactory into one iaFactory handling every IA URL shape. - parseIASearchURL -> parseIASearchURLQuery, returning string | null instead of a single-field wrapper object. Addresses all actionable comments from asteasolutions#96 (review)
- fetchIASearchCount no longer calls excludeIACollections internally; the one call site (iaFactory) now passes the already-filtered query, so the count function has no special knowledge of collection exclusion. - Removed three comments describing straightforward code rather than a non-obvious constraint (the iaFactory summary, the emptyPlaceholder field doc, the excludeIACollections rationale). - Added tab= support to parseIASearchURLQuery: archive.org/search's media-type tabs (Books/Documents, Video, Audio, Software, Images, Live Music, Data) map directly onto the existing IAMediaType values and now constrain the query with an added `mediatype:` clause - verified against the real site (which tab produces which tab= value) and the real advancedsearch.php API (the composed query returns the correctly filtered result). Deliberately not honoring tab=collection (would always return zero results against our own collection exclusion) or tab=radio/tv/fulltext (no corresponding mediatype value - these aren't part of the standard media-type facet at all).
We don't support image types or full-text search filtering yet, so honoring the tab= parameter would only be a partial implementation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
zmarinov-astea
approved these changes
Aug 25, 2026
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.
Summary
https://archive.org/search?query=subject%3A%22Gondavalekar%22) and opens the existing IA import picker so the user can choose which results to import, up to the sharedMAX_SELECTIONcap.HandleIAImportDialog/IAImport/import-items-listpicker mechanism (originally built forIACollection/IAPlaylist), adding a newIASearchCollectionmember and a sibling list component that queries the raw search string instead ofcollection:<id>.IACollection/IAPlaylistalready behave.Test plan
tsc --buildpasses incoreandclienteslintpasses incoreandclientprettier --checkpasses incoreandclientarchive.org/search?query=...URL into a tapestry and confirm the picker opens, lists results, "select all" respects the 50-item cap, and confirmed items import correctly