Commit f859003a0a

f859003a0a0ed26a2df21a4a59257aec42f99c4f

parent: 6f19377ffb

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-21 14:50 UTC

Add: Gave structs a json name

Layout: unified · split

internal/structs.go +32 −23
@@ -1,41 +1,50 @@
11package internal
22
33type AnimeTitle struct {
4 Romaji string
5 English string
6 Japanese string
4 Romaji string `json:"title_romanji"`
5 English string `json:"title"`
6 Japanese string `json:"title_japanese"`
77}
88
99type Anime struct {
10 Title AnimeTitle
11 Ep Episode
12 TotalEpisodes int
13 MalId int
14 AnilistId int
15 AllanimeId string
10 Title AnimeTitle `json:"title"`
11 Ep Episode `json:"ep"`
12 CoverImage string `json:"url"` // Assuming this field corresponds to the cover image URL
13 TotalEpisodes int `json:"total_episodes"` // If provided by the API
14 MalId int `json:"mal_id"`
15 AnilistId int `json:"anilist_id"` // Assuming you have an Anilist ID in your struct
16 AllanimeId string // Can be populated as necessary
17}
18
19type Skip struct {
20 Start int `json:"start"`
21 End int `json:"end"`
1622}
1723
1824type SkipTimes struct {
19 Op int
20 Ed int
25 Op Skip `json:"op"`
26 Ed Skip `json:"ed"`
2127}
2228
2329type 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
30 Title AnimeTitle `json:"title"`
31 Number int `json:"number"`
32 SkipTimes SkipTimes `json:"skip_times"`
33 Player playingVideo `json:"player"`
34 Resume bool `json:"resume"`
35 Started bool `json:"started"`
36 Duration int `json:"duration"`
37 Links []string `json:"links"`
38 IsFiller bool `json:"filler"`
39 IsRecap bool `json:"recap"`
40 Aired string `json:"aired"`
41 Synopsis string `json:"synopsis"`
3342}
3443
3544type playingVideo struct {
36 Url string
37 Speed float64
38 PlaybackTime int
45 Url string
46 Speed float64 `json:"speed"`
47 PlaybackTime int `json:"playback_time"`
3948}
4049
4150type User struct {