mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 21:57:06 +02:00
Maloja listens import
This commit is contained in:
parent
ca745038e3
commit
5a85987476
5 changed files with 118 additions and 1 deletions
|
@ -21,12 +21,23 @@ THE SOFTWARE.
|
|||
*/
|
||||
package maloja
|
||||
|
||||
type GenericResult struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type GetScrobblesResult struct {
|
||||
Status string `json:"status"`
|
||||
GenericResult
|
||||
List []Scrobble `json:"list"`
|
||||
Pagination Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type NewScrobbleResult struct {
|
||||
GenericResult
|
||||
Track Track `json:"track"`
|
||||
Description string `json:"desc"`
|
||||
Error Error `json:"error"`
|
||||
}
|
||||
|
||||
type Scrobble struct {
|
||||
ListenedAt int64 `json:"time"`
|
||||
Duration int64 `json:"duration"`
|
||||
|
@ -36,6 +47,19 @@ type Scrobble struct {
|
|||
Track Track `json:"track"`
|
||||
}
|
||||
|
||||
type NewScrobble struct {
|
||||
Key string `json:"key"`
|
||||
Artist string `json:"artist,omitempty"`
|
||||
Artists []string `json:"artists,omitempty"`
|
||||
Title string `json:"title"`
|
||||
Album string `json:"album,omitempty"`
|
||||
AlbumArtists []string `json:"albumartists,omitempty"`
|
||||
Duration int64 `json:"duration,omitempty"`
|
||||
Length int64 `json:"length,omitempty"`
|
||||
Time int64 `json:"time,omitempty"`
|
||||
Nofix bool `json:"nofix,omitempty"`
|
||||
}
|
||||
|
||||
type Track struct {
|
||||
Title string `json:"title"`
|
||||
Artists []string `json:"artists"`
|
||||
|
@ -54,3 +78,9 @@ type Pagination struct {
|
|||
NextPage string `json:"next_page"`
|
||||
PrevPage string `json:"prev_page"`
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
Type string `json:"type"`
|
||||
Value string `json:"value"`
|
||||
Description string `json:"desc"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue