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

+1 -1
View File
@@ -3,7 +3,7 @@ module ym-dl
go 1.27.2 go 1.27.2
require ( require (
gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261014200451-02a6dabcfbea gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261018055743-0456ca0665a6
github.com/bogem/id3v2 v1.2.0 github.com/bogem/id3v2 v1.2.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.60.1 modernc.org/sqlite v1.60.1
+2
View File
@@ -1,5 +1,7 @@
gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261014200451-02a6dabcfbea h1:JOsFlBq/AdrAeyus0+KNSiISXodjyejRb6z5VOgk+n8= gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261014200451-02a6dabcfbea h1:JOsFlBq/AdrAeyus0+KNSiISXodjyejRb6z5VOgk+n8=
gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261014200451-02a6dabcfbea/go.mod h1:L+GcqPRZiu0Srq6+YxfdLztltXV8DcxKjNUOXWJvR9o= gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261014200451-02a6dabcfbea/go.mod h1:L+GcqPRZiu0Srq6+YxfdLztltXV8DcxKjNUOXWJvR9o=
gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261018055743-0456ca0665a6 h1:3LRfiTAVWsFG6lzkQV7VhUx+uOie/AYk8uPJQISotaQ=
gitea.mrixs.me/Mrixs/yandex-music-api-go v0.0.0-20261018055743-0456ca0665a6/go.mod h1:L+GcqPRZiu0Srq6+YxfdLztltXV8DcxKjNUOXWJvR9o=
github.com/bogem/id3v2 v1.2.0 h1:hKDF+F1gOgQ5r1QmBCEZUk4MveJbKxCeIDSBU7CQ4oI= github.com/bogem/id3v2 v1.2.0 h1:hKDF+F1gOgQ5r1QmBCEZUk4MveJbKxCeIDSBU7CQ4oI=
github.com/bogem/id3v2 v1.2.0/go.mod h1:t78PK5AQ56Q47kizpYiV6gtjj3jfxlz87oFpty8DYs8= github.com/bogem/id3v2 v1.2.0/go.mod h1:t78PK5AQ56Q47kizpYiV6gtjj3jfxlz87oFpty8DYs8=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+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 // checkArtistTracks checks for new tracks from an artist
func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistName string) { func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistName string) {
page := 1 page := 0
pageSize := 50 pageSize := 50
for { for {
@@ -174,7 +174,7 @@ func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistNam
// checkArtistAlbums checks for new albums from an artist // checkArtistAlbums checks for new albums from an artist
func (m *Monitor) checkArtistAlbums(ctx context.Context, artistID int, artistName string) { func (m *Monitor) checkArtistAlbums(ctx context.Context, artistID int, artistName string) {
page := 1 page := 0
pageSize := 50 pageSize := 50
for { for {
+18 -2
View File
@@ -72,12 +72,28 @@ func NewYandexClient(cfg *config.YandexConfig, debug bool) (*YandexClient, error
// GetArtistTracks fetches tracks for an artist // GetArtistTracks fetches tracks for an artist
func (c *YandexClient) GetArtistTracks(ctx context.Context, artistID int, page, pageSize int) ([]*yandexmusic.Track, error) { 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 // GetArtistAlbums fetches albums for an artist
func (c *YandexClient) GetArtistAlbums(ctx context.Context, artistID int, page, pageSize int) ([]*yandexmusic.Album, error) { 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 // GetAlbumWithTracks fetches an album with its tracks