feat: YouTube video/music search in panel (yt-dlp ytsearch) + toggle - #3
Open
aarontanx wants to merge 4 commits into
Open
feat: YouTube video/music search in panel (yt-dlp ytsearch) + toggle#3aarontanx wants to merge 4 commits into
aarontanx wants to merge 4 commits into
Conversation
- cliamp-library: add yt_search() using yt-dlp ytsearchN:query (same backend as cliamp's youtube provider strings ytsearch1:/ytsearch10:), merge Subsonic search3 rows with YouTube rows, filter channels (YoutubeTab) and require 11-char video IDs, add play-youtube to build a one-track scratch playlist from https://www.youtube.com/watch?v=ID so the daemon can play without Subsonic. Works without a Navidrome host (host absence no longer blanks search). - Model.js: parseResults now handles kind=youtube (with url), sample updated, row conditional url to keep existing tests green. - Service.qml: playResult routes youtube kind to play-youtube with title/artist for TOML metadata. - Library.qml: placeholder updated to reflect YouTube. Fixes panel showing only playlists (matchPlaylists) when [ytmusic] enabled but no Subsonic, and enables video/music search like TUI Ctrl+F. Tested: search rick astley -> 7 youtube rows, play-youtube loads cliampui.toml and cliamp plays (duration 213, stream true).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- manifest: add enableYoutubeSearch boolean (default true) with schema, README settings table + notes updated - Service.qml: boolSetting enableYoutubeSearch, _dispatchLibrary adds --no-youtube when disabled, filters youtube rows post-parse - cliamp-library: search honors --no-youtube flag to skip yt_search - Library.qml: inline 'YouTube search ON/OFF' row + toggleYoutubeRequested signal - Panel.qml: handle toggle, persist via bar.shell.updateEntryInline and re-trigger current search Toggle via bar settings UI or library row, or CLI: omarchy bar set io.github.thisisgm.cliampui enableYoutubeSearch false --json omarchy bar set io.github.thisisgm.cliampui enableYoutubeSearch true --json
Fixes plugin widget failing to load (Service unavailable) after toggle feature - syntax error at 695:11 Expected token ','
Library/OutputSheet emit hovered onContainsMouseChanged -> Panel.cursorIndex follows mouse (matches CursorSurface contract, audio panel SinkRow pattern) Service: isYoutube fix dropped shuffle/repeat/total/volumeDb causing ReferenceError and missing button; restore them and keep isYoutube canSeek exception; fixes volumeDb not defined at playerUnity NowPlaying: keep draggable scrub (progressBar.scrubbing) already live
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.
feat: YouTube video/music search in panel (yt-dlp ytsearch) + toggle
Fixes panel only showing playlists when
[ytmusic]is enabled — no video/music results, even though TUICtrl+Fdoes search YouTube.Problem
cliamp-libraryonly spoke Subsonic (/rest/streamtoken →search3/getAlbumList2). With no Navidrome host (e.g.config.tomlonly has[ytmusic] enabled=trueand radio),server_from()returnedNoneandsearchprinted[]. Playlists still appeared viaModel.matchPlaylists()fromcliamp playlist list, so users saw “only playlists from YouTube Music” and no video/music results — even though cliamp TUICtrl+Fprovider-search (stringsytsearch1:/ytsearch10:) does search YouTube viayt-dlp.Socket has no
searchcommand ({"cmd":"search"}→unknown command), so panel had no YouTube path.Solution
Mirror TUI's YouTube search in the panel using the same
yt-dlpbackend the youtube provider uses, with a toggle.cliamp-libraryYT_SEARCH_LIMIT=8,YT_SEARCH_TIMEOUT=15,yt_search(query)→yt-dlp --flat-playlist --print-json ytsearchN:query(NDJSON). Filters channels (ie_key==YoutubeTab, channel URLs, non-11-char IDs) and keeps only videos (ie_key==Youtube+watch?v=). Returnskind:"youtube"rows withurl. Never raises — missingyt-dlpreturns[]so Subsonic outage doesn't blank panel.play_youtube(id, title, artist)→ writes~/.config/cliamp/playlists/cliampui.tomlwithpath="https://www.youtube.com/watch?v=ID"(cliamp youtube provider resolves via yt-dlp), thencliamp load cliampui.main():play-youtube/play-ythandled without Subsonic host;albums/searchno longer early-exit on missing host — they return Subsonic rows (or[]) and still runyt_search.searchmergessearch3+yt_searchand honors--no-youtubeflag.Model.jsparseResultshandleskind=="youtube"(conditionalurlto keeptests/model.test.jsgreen).Service.qmlplayResult()routesyoutube→[libraryHelper, "play-youtube", id, name, artist].enableYoutubeSearch: boolSetting("enableYoutubeSearch", true),_dispatchLibrary()adds--no-youtubewhen disabled, and filtersyoutuberows post-parse as safety.manifest.json+README.mdenableYoutubeSearch(boolean, defaulttrue, schema + defaults), settings table updated.Library.qmlSearch songs, albums, playlists and YouTube.YouTube search ON/OFFrow (CursorSurface) +toggleYoutubeRequestedsignal.Panel.qmlonToggleYoutubeRequested: togglesenableYoutubeSearchviaroot.settings+bar.shell.updateEntryInlineand re-triggers current search.Toggle
Settings UI (auto-generated from
manifest.jsonschema) → Search YouTube in library (default ON). Or inline:YouTube search ON/OFFrow (click to toggle, persists)When OFF,
cliamp-library search --no-youtubeskipsyt-dlpentirely (no network, no delay) and panel shows only Subsonic + playlists, like before.Testing
Panel: search “lofi” →
YOUTUBErows appear alongside album/song/playlist when ON, disappear when OFF; toggle via library row instantly refreshes; Enter plays immediately (daemon stays, no TUI kill).Notes
yt-dlponPATH(already used by cliamp's youtube provider,2026.08.19tested). If missing, falls back to Subsonic only.albumProcesssingle-flight prevents overlappingyt-dlpruns.ytsearch, uses anonymous YouTube search.play-youtubeaccepts full URL as well.Closes the reported issue: search now finds YouTube videos/music just like TUI
Ctrl+F, with toggle to keep it Subsonic-only.