From 0c28bfd05003851e9391bf015a0c51e0148554a8 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 29 May 2026 10:00:15 -0700 Subject: [PATCH 1/2] feat(tracks): allow custom genres; cap at 100 chars - v1_track.go: drop `oneof=...` enum validators on CreateTrackRequest.Genre and UpdateTrackRequest.Genre; replace with min/max length constraints - swagger/swagger-v1.yaml: genre schema changed from string-enum to plain string with maxLength=100; canonical values moved into description so generated docs/SDKs still surface known autocomplete options Co-Authored-By: Claude Opus 4.7 (1M context) --- api/swagger/swagger-v1.yaml | 64 +++++++------------------------------ api/v1_track.go | 4 +-- 2 files changed, 13 insertions(+), 55 deletions(-) diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index 9a006a90..e4f28066 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -14387,59 +14387,17 @@ components: $ref: "#/components/schemas/grant" genre: type: string - description: Music genre - enum: - - Electronic - - Rock - - Metal - - Alternative - - Hip-Hop/Rap - - Experimental - - Punk - - Folk - - Pop - - Ambient - - Soundtrack - - World - - Jazz - - Acoustic - - Funk - - R&B/Soul - - Devotional - - Classical - - Reggae - - Podcasts - - Country - - Spoken Word - - Comedy - - Blues - - Kids - - Audiobooks - - Latin - - Lo-Fi - - Hyperpop - - Dancehall - - Techno - - Trap - - House - - Tech House - - Deep House - - Disco - - Electro - - Jungle - - Progressive House - - Hardstyle - - Glitch Hop - - Trance - - Future Bass - - Future House - - Tropical House - - Downtempo - - Drum & Bass - - Dubstep - - Jersey Club - - Vaporwave - - Moombahton + maxLength: 100 + description: | + Music genre. Any string up to 100 characters is accepted. Known/canonical + values (shown as autocomplete suggestions in clients): Electronic, Rock, + Metal, Alternative, Hip-Hop/Rap, Experimental, Punk, Folk, Pop, Ambient, + Soundtrack, World, Jazz, Acoustic, Funk, R&B/Soul, Devotional, Classical, + Reggae, Podcasts, Country, Spoken Word, Comedy, Blues, Kids, Audiobooks, + Latin, Lo-Fi, Hyperpop, Dancehall, Techno, Trap, House, Tech House, + Deep House, Disco, Electro, Jungle, Progressive House, Hardstyle, + Glitch Hop, Trance, Future Bass, Future House, Tropical House, Downtempo, + Drum & Bass, Dubstep, Jersey Club, Vaporwave, Moombahton. albums_response: required: - latest_chain_block diff --git a/api/v1_track.go b/api/v1_track.go index a8d24fd2..3f1fcb1b 100644 --- a/api/v1_track.go +++ b/api/v1_track.go @@ -116,7 +116,7 @@ type DDEXRightsController struct { type CreateTrackRequest struct { TrackId *trashid.HashId `json:"track_id,omitempty" validate:"omitempty,min=1"` Title string `json:"title" validate:"required,min=1"` - Genre string `json:"genre" validate:"required,oneof='Electronic' 'Rock' 'Metal' 'Alternative' 'Hip-Hop/Rap' 'Experimental' 'Punk' 'Folk' 'Pop' 'Ambient' 'Soundtrack' 'World' 'Jazz' 'Acoustic' 'Funk' 'R&B/Soul' 'Devotional' 'Classical' 'Reggae' 'Podcasts' 'Country' 'Spoken Word' 'Comedy' 'Blues' 'Kids' 'Audiobooks' 'Latin' 'Lo-Fi' 'Hyperpop' 'Dancehall' 'Techno' 'Trap' 'House' 'Tech House' 'Deep House' 'Disco' 'Electro' 'Jungle' 'Progressive House' 'Hardstyle' 'Glitch Hop' 'Trance' 'Future Bass' 'Future House' 'Tropical House' 'Downtempo' 'Drum & Bass' 'Dubstep' 'Jersey Club' 'Vaporwave' 'Moombahton'"` + Genre string `json:"genre" validate:"required,min=1,max=100"` Description *string `json:"description,omitempty" validate:"omitempty,max=1000"` Mood *string `json:"mood,omitempty" validate:"omitempty,oneof='Peaceful' 'Romantic' 'Sentimental' 'Tender' 'Easygoing' 'Yearning' 'Sophisticated' 'Sensual' 'Cool' 'Gritty' 'Melancholy' 'Serious' 'Brooding' 'Fiery' 'Defiant' 'Aggressive' 'Rowdy' 'Excited' 'Energizing' 'Empowering' 'Stirring' 'Upbeat' 'Other'"` Tags *string `json:"tags,omitempty"` @@ -159,7 +159,7 @@ type CreateTrackRequest struct { type UpdateTrackRequest struct { Title *string `json:"title,omitempty" validate:"omitempty,min=1"` Description *string `json:"description,omitempty" validate:"omitempty,max=1000"` - Genre *string `json:"genre,omitempty" validate:"omitempty,oneof='Electronic' 'Rock' 'Metal' 'Alternative' 'Hip-Hop/Rap' 'Experimental' 'Punk' 'Folk' 'Pop' 'Ambient' 'Soundtrack' 'World' 'Jazz' 'Acoustic' 'Funk' 'R&B/Soul' 'Devotional' 'Classical' 'Reggae' 'Podcasts' 'Country' 'Spoken Word' 'Comedy' 'Blues' 'Kids' 'Audiobooks' 'Latin' 'Lo-Fi' 'Hyperpop' 'Dancehall' 'Techno' 'Trap' 'House' 'Tech House' 'Deep House' 'Disco' 'Electro' 'Jungle' 'Progressive House' 'Hardstyle' 'Glitch Hop' 'Trance' 'Future Bass' 'Future House' 'Tropical House' 'Downtempo' 'Drum & Bass' 'Dubstep' 'Jersey Club' 'Vaporwave' 'Moombahton'"` + Genre *string `json:"genre,omitempty" validate:"omitempty,min=1,max=100"` Mood *string `json:"mood,omitempty" validate:"omitempty,oneof='Peaceful' 'Romantic' 'Sentimental' 'Tender' 'Easygoing' 'Yearning' 'Sophisticated' 'Sensual' 'Cool' 'Gritty' 'Melancholy' 'Serious' 'Brooding' 'Fiery' 'Defiant' 'Aggressive' 'Rowdy' 'Excited' 'Energizing' 'Empowering' 'Stirring' 'Upbeat' 'Other'"` Tags *string `json:"tags,omitempty"` License *string `json:"license,omitempty"` From 75f360da02324161146a6e82db7126058ea5e2ae Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 29 May 2026 13:07:13 -0700 Subject: [PATCH 2/2] feat(indexer): add MaxTrackGenreLength constant for upcoming track-event consumer When the Go indexer takes over track entity-event consumption from the Python discovery-provider, the genre validation must mirror the new write-time rule: arbitrary user-supplied string, no enum, just a 100-char length cap. Land the constant next to Entity_Track so future track-event handler implementations pick it up by default. Co-Authored-By: Claude Opus 4.7 (1M context) --- indexer/constants.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indexer/constants.go b/indexer/constants.go index 0fe8dd4f..7e08caf2 100644 --- a/indexer/constants.go +++ b/indexer/constants.go @@ -39,3 +39,12 @@ const ( Entity_DeveloperApp = "DeveloperApp" Entity_Event = "Event" ) + +// Track field constraints applied at EM-event indexing time. Track genres are +// arbitrary user-supplied strings (not an enum); enforce only a length cap. +// Mirrors discovery-provider's `CHARACTER_LIMIT_GENRE` so that when the Go +// indexer takes over track-entity event consumption from the Python +// discovery-provider, the rule stays consistent. +const ( + MaxTrackGenreLength = 100 +)