Commit 1983af7d32
Unsigned
Layout: unified · split
internal/structs.go added +88
| @@ -0,0 +1,88 @@ | |||
| 1 | package internal | ||
| 2 | |||
| 3 | type AnimeTitle struct { | ||
| 4 | Romaji string | ||
| 5 | English string | ||
| 6 | Japanese string | ||
| 7 | } | ||
| 8 | |||
| 9 | type Anime struct { | ||
| 10 | Title AnimeTitle | ||
| 11 | Ep Episode | ||
| 12 | TotalEpisodes int | ||
| 13 | MalId int | ||
| 14 | AnilistId int | ||
| 15 | AllanimeId string | ||
| 16 | } | ||
| 17 | |||
| 18 | type SkipTimes struct { | ||
| 19 | Op int | ||
| 20 | Ed int | ||
| 21 | } | ||
| 22 | |||
| 23 | type Episode struct { | ||
| 24 | Tit AnimeTitle | ||
| 25 | Number int | ||
| 26 | Skip_times SkipTimes | ||
| 27 | Player playingVideo | ||
| 28 | Links []string | ||
| 29 | Is_filler bool | ||
| 30 | Is_recap bool | ||
| 31 | Aired string | ||
| 32 | Synopsis string | ||
| 33 | } | ||
| 34 | |||
| 35 | type playingVideo struct { | ||
| 36 | Url string | ||
| 37 | Speed float64 | ||
| 38 | PlaybackTime int | ||
| 39 | } | ||
| 40 | |||
| 41 | type User struct { | ||
| 42 | Token string | ||
| 43 | Username string | ||
| 44 | Id int | ||
| 45 | AnimeList AnimeList | ||
| 46 | } | ||
| 47 | |||
| 48 | // AniListAnime is the struct for the API response | ||
| 49 | type AniListAnime struct { | ||
| 50 | ID int `json:"id"` | ||
| 51 | Title struct { | ||
| 52 | Romaji string `json:"romaji"` | ||
| 53 | English string `json:"english"` | ||
| 54 | Native string `json:"native"` | ||
| 55 | } `json:"title"` | ||
| 56 | } | ||
| 57 | |||
| 58 | // Page represents the page in AniList response | ||
| 59 | type Page struct { | ||
| 60 | Media []AniListAnime `json:"media"` | ||
| 61 | } | ||
| 62 | |||
| 63 | // ResponseData represents the full response structure | ||
| 64 | type ResponseData struct { | ||
| 65 | Page Page `json:"Page"` | ||
| 66 | } | ||
| 67 | |||
| 68 | type Media struct { | ||
| 69 | Duration int `json:"duration"` | ||
| 70 | Episodes int `json:"episodes"` | ||
| 71 | ID int `json:"id"` | ||
| 72 | Title AnimeTitle `json:"title"` | ||
| 73 | } | ||
| 74 | |||
| 75 | type Entry struct { | ||
| 76 | Media Media `json:"media"` | ||
| 77 | Progress int `json:"progress"` | ||
| 78 | Score float64 `json:"score"` | ||
| 79 | Status string `json:"status"` | ||
| 80 | } | ||
| 81 | |||
| 82 | type AnimeList struct { | ||
| 83 | Watching []Entry `json:"watching"` | ||
| 84 | Completed []Entry `json:"completed"` | ||
| 85 | Paused []Entry `json:"paused"` | ||
| 86 | Dropped []Entry `json:"dropped"` | ||
| 87 | Planning []Entry `json:"planning"` | ||
| 88 | }\ No newline at end of file | ||