forked from dweymouth/go-jellyfin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
126 lines (111 loc) · 3.77 KB
/
models.go
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
package jellyfin
type ItemType string
const (
TypeArtist ItemType = "Artist"
TypeAlbum ItemType = "Album"
TypePlaylist ItemType = "Playlist"
// TypeQueue ItemType = "Queue"
// TypeHistory ItemType = "History"
TypeSong ItemType = "Song"
TypeGenre ItemType = "Genre"
)
type UserData struct {
PlayCount int `json:"PlayCount"`
IsFavorite bool `json:"IsFavorite"`
Rating int `json:"Rating"`
Played bool `json:"Played"`
LastPlayedDate string `json:"LastPlayedDate"`
}
type NameID struct {
Name string `json:"Name"`
ID string `json:"Id"`
}
type Images struct {
Primary string `json:"Primary"`
Disc string `json:"Disc"`
}
type MediaSource struct {
Bitrate int `json:"Bitrate"`
Container string `json:"Container"`
Path string `json:"Path"`
Size int `json:"Size"`
}
type Song struct {
Name string `json:"Name"`
Id string `json:"Id"`
PlaylistItemId string `json:"PlaylistItemId"`
RunTimeTicks int64 `json:"RunTimeTicks"`
ProductionYear int `json:"ProductionYear"`
DateCreated string `json:"DateCreated"`
IndexNumber int `json:"IndexNumber"`
Type string `json:"Type"`
AlbumID string `json:"AlbumId"`
Album string `json:"Album"`
DiscNumber int `json:"ParentIndexNumber"`
Artists []NameID `json:"ArtistItems"`
ImageTags Images `json:"ImageTags"`
MediaSources []MediaSource `json:"MediaSources"`
UserData UserData `json:"UserData"`
}
type songs struct {
Songs []*Song `json:"Items"`
TotalSongs int `json:"TotalRecordCount"`
}
type Artist struct {
Name string `json:"Name"`
Overview string `json:"Overview"`
ID string `json:"Id"`
RunTimeTicks int64 `json:"RunTimeTicks"`
Type string `json:"Type"`
AlbumCount int `json:"ChildCount"`
UserData UserData `json:"UserData"`
ImageTags Images `json:"ImageTags"`
}
type artists struct {
Artists []*Artist `json:"Items"`
TotalArtists int `json:"TotalRecordCount"`
}
type Album struct {
Name string `json:"Name"`
ID string `json:"Id"`
RunTimeTicks int64 `json:"RunTimeTicks"`
Year int `json:"ProductionYear"`
DateCreated string `json:"DateCreated"`
Type string `json:"Type"`
Artists []NameID `json:"AlbumArtists"`
Overview string `json:"Overview"`
Genres []string `json:"Genres"`
ChildCount int `json:"ChildCount"`
ImageTags Images `json:"ImageTags"`
UserData UserData `json:"UserData"`
}
type albums struct {
Albums []*Album `json:"Items"`
TotalAlbums int `json:"TotalRecordCount"`
}
type Playlist struct {
Name string `json:"Name"`
ID string `json:"Id"`
Overview string `json:"Overview"`
DateCreated string `json:"DateCreated"`
PremiereDate string `json:"PremiereDate"`
DateLastMediaAdded string `json:"DateLastMediaAdded"`
Genres []string `json:"Genres"`
RunTimeTicks int64 `json:"RunTimeTicks"`
Type string `json:"Type"`
MediaType string `json:"MediaType"`
ImageTags Images `json:"ImageTags"`
Tags []string `json:"Tags"`
ProviderIds map[string]string `json:"ProviderIds"`
SongCount int `json:"ChildCount"`
}
type playlists struct {
Playlists []*Playlist `json:"Items"`
TotalPlaylists int `json:"TotalRecordCount"`
}
type SearchResult struct {
Artists []*Artist
Albums []*Album
Songs []*Song
Playlists []*Playlist
}