feat(etl): decode hashid track_ids in playlist_contents (parity 5A)#249
Open
raymondjacobson wants to merge 1 commit intoetl/parity-4b-mv-refreshfrom
Open
feat(etl): decode hashid track_ids in playlist_contents (parity 5A)#249raymondjacobson wants to merge 1 commit intoetl/parity-4b-mv-refreshfrom
raymondjacobson wants to merge 1 commit intoetl/parity-4b-mv-refreshfrom
Conversation
…ty 5A)
Stack 5A. Picks up apps#14033: when playlist_contents includes a string
track_id (e.g. "1aV5byE" rather than int 28622946), decode it via the
Hashids algorithm before treating it as a track_id.
extractPlaylistTrackIDs now flows through pickPlaylistTrackID which
handles int / float64 / int64 directly and decodes string entries via
decodeTrackIDFromString. The decoder uses Hashids(min_length=5,
salt="azowernasdfoia") matching apps' helpers.decode_string_id, with a
strconv.ParseInt fallback for plain numeric strings.
Hashids logic is inlined locally rather than imported from
go-openaudio/pkg/hashes because pkg/etl is a separate Go module. Adds
github.com/speps/go-hashids/v2 to pkg/etl/go.mod (already used by the
sibling pkg/hashes).
Tests added for hashid decoding and numeric-string fallback. Verified
against Python:
Hashids(min_length=5, salt='azowernasdfoia').decode('1aV5byE') == (1031900541,)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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
Stack 5A. Picks up apps#14033: when `playlist_contents` includes a string track_id (e.g. `"1aV5byE"` rather than int 28622946), decode it via the Hashids algorithm before treating it as a track_id. Without this, a single playlist with a hashid-encoded entry halts indexing of the whole block.
`extractPlaylistTrackIDs` now flows through `pickPlaylistTrackID` which:
The Hashids decoder uses `Hashids(min_length=5, salt="azowernasdfoia")` matching apps' `helpers.decode_string_id`. Logic is inlined locally rather than imported from `go-openaudio/pkg/hashes` because `pkg/etl` is a separate Go module — adds `github.com/speps/go-hashids/v2` to `pkg/etl/go.mod` (already used by the sibling `pkg/hashes`).
Verified against Python:
```python
Stack context
Stacked on #248 (4B — MV refresh).
Test plan
🤖 Generated with Claude Code