Skip to content

feat(trending-challenge-rewards): add winning track titles + URLs to the digest - #91

Merged
dylanjeffers merged 1 commit into
mainfrom
feat/trending-digest-track-urls
Aug 28, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
feat/trending-digest-track-urls

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Why

Requested by Michael in #eng-support: the digest in #trending-challenge-reward-notifications only lists handles, so an artist with several trending tracks gives no way to tell which track actually won — especially now that trending fall-off moved from 7 to 10 days.

What

  • queryTrackLinks() resolves each winner's track from trending_results.id (the numeric track id stored as text — see handle_trending.sql) joined to the current track_routes row plus the owner's handle. Permalink shape /{handle}/{slug} matches how the API builds Track.permalink (api/dbv1/tracks.go).
  • composeTrackLinks() renders a rank / handle / linked-title list, posted in the same Slack message directly under the existing block.
  • The tweet code block is unchanged byte-for-byte, so the copy-paste-to-Twitter flow still works. The links sit outside the fence because Slack doesn't hyperlink inside a code block.

Sample output

Top 10 Trending Tracks 🔥 (2026-08-28)
@soundsbymystic
@AspireHigher
@mizterbonezz_92

Top 10 Trending Tracks 🔥

  1. @soundsbymystic — <https://audius.co/soundsbymystic/mstic-speckz-pain-killer|M?STIC & SPECKZ - PAIN KILLER>
  2. @aspirehigher — <https://audius.co/AspireHigher/smokestax-get-down|Smokestax - Get Down>
  3. @mizterbonezz_92 — <https://audius.co/mizterbonezzmusic/durango-clandestino|Durango Clandestino>

(Rank 3 shows the Twitter handle @mizterbonezz_92 next to the Audius handle mizterbonezzmusic in the URL — different namespaces, working as intended.)

Testing

  • 5 new unit tests in trending.test.ts covering permalink construction, the missing-route fallback, the empty-id short circuit, entry assembly, and rank ordering. All 10 pass.
  • tsc --noEmit clean (the ~1,748 viem type errors are pre-existing on main).
  • Permalink format verified against live /v1/full/tracks/trending/winners.

🤖 Generated with Claude Code

…the digest

The Slack digest in #trending-challenge-reward-notifications only listed
handles, so an artist with several trending tracks gave no way to tell
which track actually won.

Resolve each winner's track via `trending_results.id` (the numeric track
id as text) joined to the current `track_routes` row, and post a linked
list under the existing tweet block: rank, handle, and the track title
linking to its audius.co permalink.

The tweet code block is unchanged byte-for-byte so the copy-paste-to-
Twitter flow still works; the links ride along in the same message,
outside the fence, so Slack renders them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dylanjeffers
dylanjeffers merged commit fe4d8df into main Aug 28, 2026
2 checks passed
@dylanjeffers
dylanjeffers deleted the feat/trending-digest-track-urls branch August 28, 2026 20:55
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