mirror of
https://github.com/AynaLivePlayer/miaosic.git
synced 2025-12-06 13:02:48 +08:00
breaking change: change json key to lowercase
This commit is contained in:
18
lyric.go
18
lyric.go
@@ -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 {
|
||||
|
||||
24
miaosic.go
24
miaosic.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user