Update yandex-music-api-go library
CI/CD / test (push) Successful in 1m35s
CI/CD / build (push) Successful in 52s
CI/CD / docker (push) Canceled after 13s

Upgrade to v0.0.0-20261018055743-0456ca0665a6 which fixes the
page=0 validation bug in GetArtistTracks/GetArtistAlbums.

The library now returns *ArtistTracks/*ArtistAlbums wrappers
instead of raw slices, so the YandexClient wrapper extracts
the inner slices for backward compatibility.

Reverted page numbering back to 0 in monitor since the API
bug is fixed server-side/library-side.
This commit is contained in:
Mrixs committed 2026-10-18 09:15:19 +03:00
1 parent ed6c26a3af
commit c228e7e2b7
4 files changed
+23 -5

No files matched your search

+2 -2
View File
@@ -136,7 +136,7 @@ func (m *Monitor) checkArtist(ctx context.Context, artistID int) {
// checkArtistTracks checks for new tracks from an artist
func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistName string) {
page := 1
page := 0
pageSize := 50
for {
@@ -174,7 +174,7 @@ func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistNam
// checkArtistAlbums checks for new albums from an artist
func (m *Monitor) checkArtistAlbums(ctx context.Context, artistID int, artistName string) {
page := 1
page := 0
pageSize := 50
for {
+18 -2
View File
@@ -72,12 +72,28 @@ func NewYandexClient(cfg *config.YandexConfig, debug bool) (*YandexClient, error
// GetArtistTracks fetches tracks for an artist
func (c *YandexClient) GetArtistTracks(ctx context.Context, artistID int, page, pageSize int) ([]*yandexmusic.Track, error) {
return c.client.GetArtistTracks(ctx, fmt.Sprintf("%d", artistID), page, pageSize)
result, err := c.client.GetArtistTracks(ctx, fmt.Sprintf("%d", artistID), page, pageSize)
if err != nil {
return nil, err
}
tracks := make([]*yandexmusic.Track, 0, len(result.Tracks))
for i := range result.Tracks {
tracks = append(tracks, &result.Tracks[i])
}
return tracks, nil
}
// GetArtistAlbums fetches albums for an artist
func (c *YandexClient) GetArtistAlbums(ctx context.Context, artistID int, page, pageSize int) ([]*yandexmusic.Album, error) {
return c.client.GetArtistAlbums(ctx, fmt.Sprintf("%d", artistID), page, pageSize)
result, err := c.client.GetArtistAlbums(ctx, fmt.Sprintf("%d", artistID), page, pageSize)
if err != nil {
return nil, err
}
albums := make([]*yandexmusic.Album, 0, len(result.Albums))
for i := range result.Albums {
albums = append(albums, &result.Albums[i])
}
return albums, nil
}
// GetAlbumWithTracks fetches an album with its tracks