Fix JSONID type conversions for yandex-music-api-go v0.0.0-20261018072517-d0173f795d2a
CI/CD / test (push) Successful in 48s
CI/CD / build (push) Successful in 54s
CI/CD / docker (push) Successful in 2m31s

The new library version uses models.JSONID (custom string type) for ID
fields instead of plain string. Convert to string where IDs are passed
to functions expecting string or compared with string values.

Affected: client.go (GetTrackInfoWithPosition), downloader.go
(track.ID usage), monitor.go (track.ID, album.ID usage), storage.go
(album/track ID assignment).
This commit is contained in:
Mrixs committed 2026-10-18 10:39:43 +03:00
1 parent 5d32daad07
commit 4e6bef40e3
6 files changed
+23 -21

No files matched your search

+5 -5
View File
@@ -152,9 +152,9 @@ func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistNam
newTracks := 0
for _, track := range tracks {
if !m.storage.IsTrackDownloaded(track.ID) {
m.logger.Info("new track found", "track_id", track.ID, "artist", artistName)
result := m.downloader.DownloadTrack(ctx, track.ID)
if !m.storage.IsTrackDownloaded(string(track.ID)) {
m.logger.Info("new track found", "track_id", string(track.ID), "artist", artistName)
result := m.downloader.DownloadTrack(ctx, string(track.ID))
if result.Success {
newTracks++
} else {
@@ -190,10 +190,10 @@ func (m *Monitor) checkArtistAlbums(ctx context.Context, artistID int, artistNam
newAlbums := 0
for _, album := range albums {
albumIDStr := album.ID
albumIDStr := string(album.ID)
if !m.isAlbumDownloaded(albumIDStr, album.TrackCount) {
m.logger.Info("new album found", "album_id", albumIDStr, "title", album.Title, "artist", artistName)
results := m.downloader.DownloadAlbum(ctx, album.ID)
results := m.downloader.DownloadAlbum(ctx, string(album.ID))
success := false
for _, r := range results {
if r.Success {