Skip to content

Update copyright field type to interface{} in search and tracks OpenA…#9

Merged
Zibbp merged 1 commit into
Zibbp:mainfrom
LeonardoSola:fix-copyright-convert-bug
Jan 19, 2026
Merged

Update copyright field type to interface{} in search and tracks OpenA…#9
Zibbp merged 1 commit into
Zibbp:mainfrom
LeonardoSola:fix-copyright-convert-bug

Conversation

@LeonardoSola
Copy link
Copy Markdown
Contributor

@LeonardoSola LeonardoSola commented Jan 19, 2026

Description

While syncing tracks, the application fails to match some Spotify tracks with Tidal due to a JSON unmarshal error:

2:27AM ERR failed to find track on Tidal error="json: cannot unmarshal object into Go struct field TracksAttributes.data.attributes.copyright of type string" spotify_track_id=56sk7jBpZV0CD31G9hEU3b spotify_track_isrc=USJI10600117 spotify_track_name="Animal I Have Become"
2:27AM ERR failed to find track on Tidal error="json: cannot unmarshal object into Go struct field TracksAttributes.data.attributes.copyright of type string" spotify_track_id=3K4HG9evC7dg3N0R9cYqk4 spotify_track_isrc=USWB10002399 spotify_track_name="One Step Closer"
2:27AM ERR failed to find track on Tidal error="json: cannot unmarshal object into Go struct field TracksAttributes.data.attributes.copyright of type string" spotify_track_id=6RJdYpFQwLyNfDc5FbjkgV spotify_track_isrc=USRE10500766 spotify_track_name=Stricken
2:27AM ERR failed to find track on Tidal error="json: cannot unmarshal object into Go struct field TracksAttributes.data.attributes.copyright of type string" spotify_track_id=0jY829pCMnstlNtaE72vSB spotify_track_isrc=USRE10501019 spotify_track_name=Decadence

This happens because the copyright field returned by Tidal is not always a string — in some cases, it is an object.

Fix

This PR updates the Copyright field type from *string to interface{} to allow proper unmarshalling regardless of the response format.

Notes

The copyright field is currently not used anywhere in the codebase.

This change only prevents the unmarshal error and does not affect existing behavior.

Copy link
Copy Markdown
Owner

@Zibbp Zibbp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
FYI I switched over to using https://github.com/spotify2tidal/spotify_to_tidal

@Zibbp Zibbp merged commit 30188f3 into Zibbp:main Jan 19, 2026
1 check passed
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.

2 participants