-
Notifications
You must be signed in to change notification settings - Fork 0
/
optionalFields.go
179 lines (153 loc) · 5.68 KB
/
optionalFields.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
package myanimelist
// Custom field, applicable to both Anime.Details() and Manga.Details().
// Transforms into all available fields before sending request.
const FieldAllAvailable string = "*"
// Shared fields for both Anime.Details() and Manga.Details().
const (
FieldID string = "id"
FieldTitle string = "title"
FieldMainPicture string = "main_picture"
FieldAlternativeTitles string = "alternative_titles"
FieldStartDate string = "start_date"
FieldEndDate string = "end_date"
FieldSynopsis string = "synopsis"
FieldMean string = "mean"
FieldRank string = "rank"
FieldPopularity string = "popularity"
FieldNumListUsers string = "num_list_users"
FieldNumScoringUsers string = "num_scoring_users"
FieldNSFW string = "nsfw"
FieldCreatedAt string = "created_at"
FieldUpdatedAt string = "updated_at"
FieldMediaType string = "media_type"
FieldStatus string = "status"
FieldGenres string = "genres"
FieldMyListStatus string = "my_list_status"
FieldPictures string = "pictures"
FieldBackground string = "background"
FieldRelatedAnime string = "related_anime"
FieldRelatedManga string = "related_manga"
FieldRecommendations string = "recommendations"
FieldStudios string = "studios"
FieldStatistics string = "statistics"
)
var generalFields = []string{FieldID, FieldTitle, FieldMainPicture, FieldAlternativeTitles,
FieldStartDate, FieldEndDate, FieldSynopsis, FieldMean, FieldRank, FieldPopularity,
FieldNumListUsers, FieldNumScoringUsers, FieldNSFW, FieldCreatedAt, FieldUpdatedAt,
FieldMediaType, FieldStatus, FieldGenres, FieldMyListStatus, FieldPictures,
FieldBackground, FieldRelatedAnime, FieldRelatedManga, FieldRecommendations, FieldStatistics}
// Anime.Details() only fields
const (
FieldNumEpisodes string = "num_episodes"
FieldStartSeason string = "start_season"
FieldBroadcast string = "broadcast"
FieldSource string = "source"
FieldAverageEpisodeDuration string = "average_episode_duration"
FieldRating string = "rating"
)
var animeFields = []string{FieldNumEpisodes, FieldStartSeason, FieldBroadcast, FieldSource,
FieldAverageEpisodeDuration, FieldRating, FieldStudios}
// Manga.Details() only fields.
const (
FieldNumVolumes string = "num_volumes"
FieldNumChapters string = "num_chapters"
FieldAuthors string = "authors{first_name,last_name}"
FieldSerialization string = "serialization{name}"
)
var mangaFields = []string{FieldNumVolumes, FieldNumChapters, FieldAuthors, FieldSerialization}
// Shared ranks for both Anime.Top() and Manga.Top().
const (
// Top Anime|Manga Series
RankAll string = "all"
// Top Anime|Manga by Popularity
RankByPopularity string = "bypopularity"
// Top Anime|Manga by Favorite
RankFavorite string = "favorite"
)
var generalRankings = []string{RankAll, RankByPopularity, RankFavorite}
// Anime.Top() only
const (
// Top Airing Anime
RankAiring string = "airing"
// Top Upcoming Anime
RankUpcoming string = "upcoming"
// Top Anime TV Series
RankTV string = "tv"
// Top Anime OVA Series
RankOVA string = "ova"
// Top Anime Movies
RankMovie string = "movie"
// Top Anime Specials
RankSpecials string = "special"
)
var animeRankings = []string{RankAiring, RankUpcoming, RankTV, RankOVA, RankMovie, RankSpecials}
// Manga.Top() only
const (
// Top Manga
RankManga string = "manga"
// Top Novels
RankNovels string = "novels"
// Top One-shots
RankOneShots string = "oneshots"
// Top Doujinshi
RankDoujinshi string = "doujin"
// Top Manhwa
RankManhwa string = "manhwa"
// Top Manhua
RankManhua string = "manhua"
)
var mangaRankings = []string{RankManga, RankNovels, RankOneShots, RankDoujinshi, RankManhwa, RankManhua}
// Shared statuses, working for Anime.List.User() && Manga.List.User()
// and for AnimeConfig.SetStatus() && MangaConfig.SetStatus() too.
const (
StatusOnHold string = "on_hold"
StatusDropped string = "dropped"
StatusCompleted string = "completed"
)
var generalStatuses = []string{StatusOnHold, StatusDropped, StatusCompleted}
// Anime-only statuses (Anime.List.User() and AnimeConfig.SetStatus())
const (
StatusWatching string = "watching"
StatusPlanToWatch string = "plan_to_watch"
)
var animeStatuses = []string{StatusWatching, StatusPlanToWatch}
// Manga-only statuses (Manga.List.User() and MangaConfig.SetStatus())
const (
StatusReading string = "reading"
StatusPlanToRead string = "plan_to_read"
)
var mangaStatuses = []string{StatusReading, StatusPlanToRead}
// Predefined season values. Used for 'Anime.Seasonal()'
const (
// January, February, March
SeasonWinter string = "winter"
// April, May, June
SeasonSpring string = "spring"
// July, August, September
SeasonSummer string = "summer"
// October, November, December
SeasonFall string = "fall"
)
var seasons = []string{SeasonWinter, SeasonSpring, SeasonSummer, SeasonFall}
// Used to sort Anime.Seasonal() response
const (
SortByScore string = "anime_score"
SortByUsersLists string = "anime_num_list_users"
)
// Anime or manga priority. Used with AnimeConfig.SetPriority() and MangaConfig.SetPriority()
const (
PriorityLow = iota
PriorityMedium
PriorityHigh
)
var priorities = []int{PriorityLow, PriorityMedium, PriorityHigh}
// User list's sort
const (
SortListByScore string = "list_score"
SortListByUpdateDate string = "list_updated_at"
SortListByTitle string = "title"
SortListByStartDate string = "start_date"
SortListByID string = "id"
)
var listSortings = []string{SortListByScore, SortListByUpdateDate, SortListByTitle,
SortListByStartDate, SortListByID}