feat(events): sort remix-contests by open/ended × audius-followed, entries desc#845
Merged
Merged
Conversation
…tries desc Replaces the prior "featured user first, has-entries next, ended-empty last" ordering on GET /v1/events/remix-contests with four explicit groups: 1. Open contests whose host is followed by the Audius account 2. Open contests whose host is not followed by the Audius account 3. Ended contests whose host is followed by the Audius account 4. Ended contests whose host is not followed by the Audius account Within each group, results sort by entry_count DESC, then by the existing end_date tiebreak, then event_id ASC for stability. The Audius account is still controlled by config.Cfg.FeaturedAudienceUserID; when it is 0 the follow tiebreak collapses and the list reduces to open-before-ended. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 22, 2026
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.
Summary
Reworks the ordering on
GET /v1/events/remix-conteststo a four-group sort, thenentry_count DESCinside each group:The Audius account is still configured via
config.Cfg.FeaturedAudienceUserID(env:featuredAudienceUserId). When it is 0, the follow-based tiebreak collapses and the list reduces to open-before-ended (still entry_count DESC inside each block).This replaces the previous "featured user first → has-entries next → ended-empty last" ordering.
Changes
api/v1_events_remix_contests.go— newORDER BY: open-vs-ended → audius-followed-vs-not (viaEXISTSonfollowswithis_current = true AND is_delete = false) →entry_count DESC→ existing end_date / event_id tiebreaks. Doc comment updated.config/config.go— updated theFeaturedAudienceUserIDcomment to reflect its new role (follow-based promotion, not direct contest featuring).api/v1_events_remix_contests_test.go:TestRemixContestsSortPriorityrewritten with 8 events covering all 4 groups × high/low entry counts, plus a subtest that unsetsFeaturedAudienceUserIDand asserts the collapsed open-before-ended fallback.TestRemixContestsFollowFilterIgnoresStaleRowsverifies that soft-deleted (is_delete=true) and non-current (is_current=false) follow rows do not promote a host into the followed sub-group.TestRemixContestsDiscoveryPageis unchanged; its active-before-ended assertion still holds under the new sort.Test plan
make test(or local equivalent) —TestRemixContestsDiscoveryPage,TestRemixContestsSortPriority,TestRemixContestsFollowFilterIgnoresStaleRows/v1/events/remix-contestsagainst a staging dataset withfeaturedAudienceUserIdset to the Audius account, confirming followed hosts surface first inside both the open and ended blocks.featuredAudienceUserId=0to confirm the open/ended split + entry_count DESC still applies.🤖 Generated with Claude Code