Commit 1983af7d32

1983af7d32b68a9c2eb1f471ec0ad44afa79631c

parent: 0b709e218f

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-20 12:28 UTC

add: Struct at one place

Layout: unified · split

internal/structs.go added +88
@@ -0,0 +1,88 @@
1package internal
2
3type AnimeTitle struct {
4 Romaji string
5 English string
6 Japanese string
7}
8
9type Anime struct {
10 Title AnimeTitle
11 Ep Episode
12 TotalEpisodes int
13 MalId int
14 AnilistId int
15 AllanimeId string
16}
17
18type SkipTimes struct {
19 Op int
20 Ed int
21}
22
23type 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
35type playingVideo struct {
36 Url string
37 Speed float64
38 PlaybackTime int
39}
40
41type 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
49type 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
59type Page struct {
60 Media []AniListAnime `json:"media"`
61}
62
63// ResponseData represents the full response structure
64type ResponseData struct {
65 Page Page `json:"Page"`
66}
67
68type Media struct {
69 Duration int `json:"duration"`
70 Episodes int `json:"episodes"`
71 ID int `json:"id"`
72 Title AnimeTitle `json:"title"`
73}
74
75type Entry struct {
76 Media Media `json:"media"`
77 Progress int `json:"progress"`
78 Score float64 `json:"score"`
79 Status string `json:"status"`
80}
81
82type 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