Skip to content

feat:search enhancements - browse results in a carousel and optionally post selected one in the channel - #57

Open
SpackledJim wants to merge 9 commits into
cbackas:mainfrom
SpackledJim:feat/search-enhancements
Open

SpackledJim wants to merge 9 commits into
cbackas:mainfrom
SpackledJim:feat/search-enhancements

Conversation

@SpackledJim

Copy link
Copy Markdown
Contributor

/search now shows up to 10 result in a private card. Pressing Send posts to the channel as a normal embed.

Fixes

  • Name searches that return nothing no longer throw (searchSeriesByName read [0] on an empty list); they reply "Show not found".
  • Name searches now show any linked channels and use the English name/overview, the same as IMDB ID searches.
  • Autocomplete labels no longer repeat the name: Name - (Name) is now Name (tt1234567)
  • The command description no longer says it links a show to a channel.

Smaller features

  • The query accepts an IMDB link as well as an ID or a show name (reuses parseIMDBIds), and autocomplete understands links too.
  • New optional year search param (ignored for IMDB IDs and links).

The new flow

  • Every successful search replies privately with a card (Discord components v2): synopsis, poster, fields, links.
  • With several name matches, a dropdown at the top of the card lists them as Title (Year) with the network underneath. It selects the current one, and Previous/Next buttons step through them (they wrap around).
  • Matches with no IMDB ID are dropped.
  • A single result (IMDB ID/link, or one name match) gets the same card without the dropdown and Previous/Next.
  • Titles show the year in parentheses unless TVDB's name already ends in one.
  • The Send button posts the current match as the original embed, with a small @user used search line above it (no ping), then deletes the private card. If the post fails, the card stays so Send can be retried.
  • Card controls are held in memory per reply: they stop working after 10 minutes or if the bot restarts. At most 10 name matches are shown.

Implementation notes

  • New src/lib/carousel.ts (sendCarousel) owns the card, dropdown, buttons and Send. It listens for component interactions on its own reply message, because the existing router only supports fixed select-menu IDs and can't carry per-reply state.
  • src/lib/tvdb.ts: getSeriesByName is replaced by getSeriesCandidates (returns up to 10 matches, optional year) and getSeriesByTvdbId; the English-translation step is shared between lookups.
  • buildShowEmbed is unchanged, so /link and /post embeds look the same; the year in the title is added in /search only.

SpackledJim and others added 9 commits October 10, 2026 13:16
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Name searches now load every match and show them one at a time in a
private message, with a dropdown to jump to any match and previous/next
buttons that wrap around. Matches without an IMDB id are dropped. Titles
show the year, unless the TVDB name already ends in one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Every successful search now shows a private card first. Its green Send
button posts the current match to the channel as a public embed, with a
small "user used search" line that doesn't mention anyone, then deletes
the private card. If the post fails the card stays so Send can be retried.

Searches by IMDB id or link, and name searches with one match, show the
same card without the dropdown and previous/next buttons.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
Name searches can be narrowed to shows first aired in a given year. The
year is ignored for IMDB ids and links, which already identify one show.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6X9gSzpaW1Z5cEET9L1pt
@SpackledJim SpackledJim changed the title Feat/search enhancements: browse results in a carousel and optionally post selected one in the channel Feat:search enhancements - browse results in a carousel and optionally post selected one in the channel Oct 11, 2026
@SpackledJim SpackledJim changed the title Feat:search enhancements - browse results in a carousel and optionally post selected one in the channel feat:search enhancements - browse results in a carousel and optionally post selected one in the channel Oct 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant