breaking change: change json key to lowercase

This commit is contained in:
aynakeya
2025-07-13 03:58:43 +08:00
parent 419d1af593
commit c1e6fc35fc
2 changed files with 21 additions and 21 deletions

View File

@@ -11,8 +11,8 @@ import (
var timeTagRegex = regexp.MustCompile("\\[[0-9]+:[0-9]+(\\.[0-9]+)?\\]")
type LyricLine struct {
Time float64 // in seconds
Lyric string
Time float64 `json:"time"` // in seconds
Lyric string `json:"lyric"`
}
func (lr LyricLine) String() string {
@@ -21,16 +21,16 @@ func (lr LyricLine) String() string {
}
type Lyrics struct {
Lang string
Content []LyricLine
Lang string `json:"lang"`
Content []LyricLine `json:"content"`
}
type LyricContext struct {
Now LyricLine
Index int
Total int
Prev []LyricLine
Next []LyricLine
Now LyricLine `json:"now"`
Index int `json:"index"`
Total int `json:"total"`
Prev []LyricLine `json:"prev"`
Next []LyricLine `json:"next"`
}
func (l *Lyrics) String() string {

View File

@@ -53,17 +53,17 @@ func NewMediaUrl(url string, quality Quality) MediaUrl {
}
type MediaInfo struct {
Title string
Artist string
Cover Picture
Album string
Meta MetaData
Title string `json:"title"`
Artist string `json:"artist"`
Cover Picture `json:"cover"`
Album string `json:"album"`
Meta MetaData `json:"meta"`
}
type Playlist struct {
Title string
Medias []MediaInfo
Meta MetaData
Title string `json:"title"`
Medias []MediaInfo `json:"medias"`
Meta MetaData `json:"meta"`
}
func (p *Playlist) DisplayName() string {
@@ -108,13 +108,13 @@ type MediaProvider interface {
}
type QrLoginSession struct {
Url string
Key string
Url string `json:"url"`
Key string `json:"key"`
}
type QrLoginResult struct {
Success bool
Message string
Success bool `json:"success"`
Message string `json:"message"`
}
type Loginable interface {