Maloja listens import

This commit is contained in:
Philipp Wolfer 2023-11-14 08:41:53 +01:00
parent ca745038e3
commit 5a85987476
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
5 changed files with 118 additions and 1 deletions

View file

@ -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"`
}