Fix R128 and remaining ID fields to accept both JSON types
- Track.R128 and TrackShort.R128: float64 → JSONR128 (accepts both JSON number and object) - All remaining primary ID fields: string → JSONID (accepts both JSON string and number) Fixed in: account, artist, clip, concert, feed, label, landing, metatag, music_history, pin, queue, radio, search, settings, supplement
This commit is contained in:
1 parent
d0173f795d
commit
dbb823ade3
18 files changed
+75
-44
No files matched your search
@@ -8,7 +8,7 @@ import (
|
||||
// Metatag represents a metatag from the Yandex Music API.
|
||||
type Metatag struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Image string `json:"image"`
|
||||
@@ -81,7 +81,7 @@ type MetatagTree struct {
|
||||
// MetatagLeaf represents a metatag leaf.
|
||||
type MetatagLeaf struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Image string `json:"image"`
|
||||
@@ -139,7 +139,7 @@ type MetatagArtistEntry struct {
|
||||
// Genre represents a genre from the Yandex Music API.
|
||||
type Genre struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Image string `json:"image"`
|
||||
@@ -205,7 +205,7 @@ func (g *Genre) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
// Chart represents a chart from the Yandex Music API.
|
||||
type Chart struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
CoverURI string `json:"cover_uri"`
|
||||
@@ -286,7 +286,7 @@ type ChartItem struct {
|
||||
// ChartInfoMenu represents a chart info menu.
|
||||
type ChartInfoMenu struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Items []ChartInfoMenuItem `json:"items"`
|
||||
@@ -295,7 +295,7 @@ type ChartInfoMenu struct {
|
||||
// ChartInfoMenuItem represents a chart info menu item.
|
||||
type ChartInfoMenuItem struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Action string `json:"action"`
|
||||
|
||||
Reference in new issue
Block a user