feat(genres): allow custom track genres#14419
Closed
dylanjeffers wants to merge 1 commit into
Closed
Conversation
- discovery indexer: drop genre allowlist enforcement at write time; cap genre at 100 chars; allowlist retained as canonical reference for read-side trending/metrics aggregations - sdk: relax track + album + playlist upload schemas to z.string().min(1).max(100); regenerate from updated swagger (generated Genre enum dropped); manual Genre enum re-exported from index with PascalCase keys to preserve @audius/sdk consumer compatibility; new GenreString = Genre | string helper type - web: SelectGenreField rewritten to TextField + native <datalist> so users can pick a known genre via autocomplete or type a custom one Read-side genre filters (trending, get_genre_metrics) still scope to the canonical set — tracks tagged with custom genres won't appear in those endpoints. Mobile genre picker is untouched and will be addressed in a follow-up PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
5 tasks
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14419.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This was referenced May 29, 2026
Contributor
Author
|
Superseded by fresh-branch PR from main: #14424 |
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
z.enum(Genre)toz.string().min(1).max(100). SDK regenerated from updated swagger (generatedGenreenum dropped). ManualGenreenum is now the canonical export from@audius/sdkwith PascalCase keys, plus a newGenreString = Genre | stringhelper type.SelectGenreFieldrewritten from<SelectField>to<TextField>+ native<datalist>— users can pick a known genre via autocomplete or type a custom one.maxLength=100gives the built-in harmony character counter.Pairs with AudiusProject/api#TBD — the Go API must ship first (or together) so it stops rejecting custom-genre POSTs before this indexer relaxation lands; otherwise tracks pass the Go validator and then hit
IndexingValidationError.What we deliberately did NOT change
index_trending.pyandget_genre_metrics.pystill scope togenre_allowlist. Custom-genre tracks silently won't appear in trending or genre-metrics endpoints — intentional MVP cut; product decision for follow-up.packages/mobilehas its own genre picker that wasn't touched — follow-up PR needed.Breaking change (browser dist only)
packages/sdk/src/sdk/types/Genre.tskeys changed from SCREAMING_SNAKE to PascalCase to match the previously-generated enum that downstream consumers (common,web,mobile) all imported. Any external integration referencingwindow.audiusSdk.Genre.HIP_HOP_RAPetc. via the browser dist needs to update toGenre.HipHopRap.Test plan
tsc --noEmitinpackages/sdk— cleanvitest runinpackages/sdk— 17 files, 196 passed, 2 skipped (incl. TracksApi / AlbumsApi / PlaylistsApi suites)node ./src/sdk/api/generator/gen.js --spec <local-edited-swagger>against the swagger with my Go-side schema changepackages/web, type a custom genre like "Phonk", confirm it submits and the track is created🤖 Generated with Claude Code