feat: add in-memory media info cache and YouTube search feature

- Add in-memory LRU cache (200 entries, 30 min TTL) to yt-dlp Client for
  GetMediaInfo and GetPlaylistInfo results, avoiding redundant yt-dlp calls
  for the same URL within a session
- Add YouTube (/search) and YouTube Music (/music) search with paginated
  results (5 per page), user selects a result to start the download flow
- Add SearchState type, new search.go handler, search results keyboard with
  < > navigation and New Search button
- Add Search button to main menu keyboard
- Update help text with new commands
This commit is contained in:
2026-06-25 22:58:20 +03:30
parent 66a8cd1128
commit 3290bb55c0
6 changed files with 246 additions and 3 deletions

View File

@@ -177,3 +177,12 @@ type PlaylistState struct {
PerPage int
Selected map[string]bool
}
// SearchState tracks the user's current search results flow.
type SearchState struct {
Query string
Entries []PlaylistEntry
Page int
PerPage int
Source string // "youtube" or "ytmusic"
}