Repository navigation
feat: search YouTube when add is given words instead of a link - #20
Open
flintwinters wants to merge 1 commit into
Open
flintwinters wants to merge 1 commit into
flintwinters wants to merge 1 commit into
Conversation
`sndcli add "artist song"` used to fail with "Not a link". Input that contains whitespace can't be a handle, so `add` now treats it as a YouTube search, takes the top result, and queues it through the same path a pasted link takes. - No new flags or help text; the only behavior change is for input that previously errored. - A single bare word still errors as before, since it could be a handle on any site. - Reuses searchYouTube() from the Spotify matcher; no new download path. - The chosen URL is printed to stderr so a wrong guess is easy to spot; stdout and --json output are unchanged. - A search with no result exits 1 before anything is claimed or queued. - Search is a HeadlessDeps seam so tests never touch the network. Tests: top result used for words; empty search fails cleanly; a bare word still errors and never searches.
flintwinters
force-pushed
the
feat/add-search
branch
from
November 22, 2026 17:11
42affbf to
645bad9
Compare
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.
Hi, and thank you for soundcli. I'm sorry for my first version of this PR, which added a flag plus README and help edits. I've reworked it to touch neither. I'm happy to change or drop this if it doesn't fit the project.
What
sndcli add "artist song name"used to fail with "Not a link". Input containing a space can't be a handle, soaddnow treats it as a YouTube search, takes the top result, and queues it the way a pasted link would be.How
--helpchange. The only behavior change is for input that previously errored.searchYouTube()from the Spotify matcher, so there's no new download path.--jsonoutput are unchanged.HeadlessDepsseam, so tests never touch the network.Checks
npm run typecheckandnpm testpass, with new tests for the top-result path, the empty-search path, and the bare-word-still-errors path.