This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathranobe.go
129 lines (102 loc) · 3.76 KB
/
ranobe.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
127
128
129
package shikimori
import (
"context"
"strconv"
)
type Ranobe struct {
ID int `json:"id"`
Name string `json:"name"`
Russian string `json:"russian"`
Image Image `json:"image"`
URL string `json:"url"`
Kind string `json:"kind"`
Score string `json:"score"`
Status string `json:"status"`
Volumes int `json:"volumes"`
Chapters int `json:"chapters"`
AiredOn string `json:"aired_on"`
ReleasedOn string `json:"released_on"`
}
type RanobeFull struct {
Ranobe
English []string `json:"english"`
Japanese []string `json:"japanese"`
Synonyms []string `json:"synonyms"`
LicenseNameRu *string `json:"license_name_ru"`
Description string `json:"description"`
DescriptionHTML string `json:"description_html"`
DescriptionSource *string `json:"description_source"`
Franchise *string `json:"franchise"`
Favoured bool `json:"favoured"`
Anons bool `json:"anons"`
Ongoing bool `json:"ongoing"`
ThreadID *int `json:"thread_id"`
TopicID *int `json:"topic_id"`
MyanimelistID int `json:"myanimelist_id"`
RatesScoresStats []RatesScoresStat `json:"rates_scores_stats"`
RatesStatusesStats []RatesStatusesStat `json:"rates_statuses_stats"`
Licensors []string `json:"licensors"`
Genres []Genre `json:"genres"`
Publishers []Publisher `json:"publishers"`
UserRate *UserRate `json:"user_rate"`
}
type RanobeParams struct{}
func (s *API) Ranobe(ctx context.Context, id int, params *RanobeParams) (resp RanobeFull, err error) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id), params)
return
}
type RanobeRole struct {
Roles []string `json:"roles"`
RolesRussian []string `json:"roles_russian"`
Character *CharacterBase `json:"character"`
Person *PersonBase `json:"person"`
}
type RanobeRolesParams struct{}
func (s *API) RanobeRoles(
ctx context.Context, id int, params *RanobeRolesParams,
) (resp []RanobeRole, err error) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id)+"/roles", params)
return
}
type RanobeSimilarParams struct{}
func (s *API) RanobeSimilar(ctx context.Context, id int, params *RanobeSimilarParams) (resp []Ranobe, err error) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id)+"/similar", params)
return
}
type RanobeRelated struct {
Relation string `json:"relation"`
RelationRussian string `json:"relation_russian"`
Anime Anime `json:"anime"`
Manga interface{} `json:"manga"`
}
type RanobeRelatedParams struct{}
func (s *API) RanobeRelated(ctx context.Context, id int, params *RanobeRelatedParams) (
resp []RanobeRelated,
err error,
) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id)+"/related", params)
return
}
type RanobeFranchiseParams struct{}
func (s *API) RanobeFranchise(ctx context.Context, id int, params *RanobeFranchiseParams) (
resp Franchise,
err error,
) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id)+"/franchise", params)
return
}
type RanobeExternalLinksParams struct{}
func (s *API) RanobeExternalLinks(ctx context.Context, id int, params *RanobeExternalLinksParams) (
resp []ExternalLink,
err error,
) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id)+"/external_links", params)
return
}
type RanobeTopicsParams struct{}
func (s *API) RanobeTopics(
ctx context.Context, id int, params *RanobeTopicsParams,
) (resp []Topic, err error) {
err = s.get(ctx, &resp, "ranobe/"+strconv.Itoa(id)+"/topics", params)
return
}