aboutsummaryrefslogtreecommitdiff
path: root/anime
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2022-02-23 16:06:42 +0000
committerGitHub <noreply@github.com>2022-02-23 16:06:42 +0000
commit90a9cdb89025930fb7f455b423593a0a35799c4a (patch)
tree1bbc1d2b57c7eb8a7a36feb51ce0656cf49faf8a /anime
parent8c685067611d829e5fb8eeaaba48508d15cd4dde (diff)
parente21dc47f2fe1dd3b1ad47224cd9cc3e75d0835fb (diff)
Merge pull request #6 from MikunoNaka/manga
Manga package completed
Diffstat (limited to 'anime')
-rw-r--r--anime/anime.structs.go48
-rw-r--r--anime/general.structs.go9
2 files changed, 19 insertions, 38 deletions
diff --git a/anime/anime.structs.go b/anime/anime.structs.go
index c7b4f00..f5fd273 100644
--- a/anime/anime.structs.go
+++ b/anime/anime.structs.go
@@ -16,37 +16,15 @@
package anime
-type AnimePicture struct {
- Medium string `json:"large"`
- Large string `json:"medium"`
-}
-
-type StatusStatistics struct {
- Watching string `json:"watching"`
- Completed string `json:"completed"`
- OnHold string `json:"on_hold"`
- Dropped string `json:"dropped"`
- PlanToWatch string `json:"plan_to_watch"`
-}
+import (
+ u "github.com/MikunoNaka/MAL2Go/util"
+)
type AnimeStatistics struct {
- Status StatusStatistics `json:"status"`
+ Status u.StatusStatistics `json:"status"`
NumListUsers int `json:"num_list_users"`
}
-type Genre struct {
- Id int `json:"id"`
- Name string `json:"name"`
-}
-
-type ListStatus struct {
- Status string `json:"status"`
- Score int `json:"score"`
- EpWatched int `json:"num_episodes_watched"`
- IsRewatching bool `json:"is_rewatching"`
- UpdatedAt string `json:"updated_at"`
-}
-
type Broadcast struct {
Day string `json:"day_of_the_week"`
Time string `json:"start_time"`
@@ -68,17 +46,19 @@ type Recommendation struct {
Num int `json:"num_recommendations"`
}
-type AltTitles struct {
- Synonyms []string `json:"synonyms"`
- En string `json:"en"`
- Ja string `json:"ja"`
+type ListStatus struct {
+ u.DefaultListStatus
+ EpWatched int `json:"num_watched_episodes"`
+ IsRewatching bool `json:"is_rewatching"`
+ TimesRewatched int `json:"num_times_rewatched"`
+ RewatchValue int `json:"rewatch_value"`
}
type Anime struct {
Id int `json:"id"`
Title string `json:"title"`
- MainPicture AnimePicture `json:"main_picture"`
- AltTitles AltTitles `json:"alternative_titles"`
+ MainPicture u.Picture `json:"main_picture"`
+ AltTitles u.AltTitles `json:"alternative_titles"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
Synopsis string `json:"synopsis"`
@@ -96,7 +76,7 @@ type Anime struct {
UpdatedAt string `json:"updated_at"`
MediaType string `json:"media_type"`
Status string `json:"status"`
- Genres []Genre `json:"genres"`
+ Genres []u.Genre `json:"genres"`
MyListStatus ListStatus `json:"my_list_status"`
NumEpisodes int `json:"num_episodes"`
StartSeason Season `json:"start_season"`
@@ -105,7 +85,7 @@ type Anime struct {
DurationSeconds int `json:"average_episode_duration"`
// Rating as in R, PG13, etc
Rating string `json:"rating"`
- Pictures []AnimePicture `json:"pictures"`
+ Pictures []u.Picture `json:"pictures"`
Background string `json:"background"`
RelatedAnime []Related `json:"related_anime"`
Recommendations []Recommendation `json:"recommendations"`
diff --git a/anime/general.structs.go b/anime/general.structs.go
index 47309c3..152eb28 100644
--- a/anime/general.structs.go
+++ b/anime/general.structs.go
@@ -16,11 +16,12 @@
package anime
+import (
+ "github.com/MikunoNaka/MAL2Go/util"
+)
+
// contains previous/next page for anime list
-type ListPaging struct {
- NextPage string `json:"next"`
- PrevPage string `json:"previous"` // might need checking
-}
+type ListPaging util.ListPaging
type Season struct {
Year int `json:"year"`