-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaylists.go
More file actions
35 lines (30 loc) · 1.05 KB
/
playlists.go
File metadata and controls
35 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package rlapi
import "context"
// Playlist represents a game playlist
type Playlist struct {
NodeID string `json:"NodeID"`
Playlist int `json:"Playlist"`
Type int `json:"Type"`
StartTime *int `json:"StartTime"`
EndTime *int `json:"EndTime"`
}
// ActivePlaylists represents all active playlists
type ActivePlaylists struct {
CasualPlaylists []Playlist `json:"CasualPlaylists"`
RankedPlaylists []Playlist `json:"RankedPlaylists"`
XPLevelUnlocked int `json:"XPLevelUnlocked"`
}
type GetActivePlaylistsResponse struct {
CasualPlaylists []Playlist `json:"CasualPlaylists"`
RankedPlaylists []Playlist `json:"RankedPlaylists"`
XPLevelUnlocked int `json:"XPLevelUnlocked"`
}
// GetActivePlaylists retrieves all currently active playlists.
func (p *PsyNetRPC) GetActivePlaylists(ctx context.Context) (*GetActivePlaylistsResponse, error) {
var result GetActivePlaylistsResponse
err := p.sendRequestSync(ctx, "Playlists/GetActivePlaylists v1", emptyRequest{}, &result)
if err != nil {
return nil, err
}
return &result, nil
}