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 @@
1package internal 1package internal
2 2
3type AnimeTitle struct { 3type AnimeTitle struct {
4 Romaji string 4 Romaji string `json:"title_romanji"`
5 English string 5 English string `json:"title"`
6 Japanese string 6 Japanese string `json:"title_japanese"`
7} 7}
8 8
9type Anime struct { 9type Anime struct {
10 Title AnimeTitle 10 Title AnimeTitle `json:"title"`
11 Ep Episode 11 Ep Episode `json:"ep"`
12 TotalEpisodes int 12 CoverImage string `json:"url"` // Assuming this field corresponds to the cover image URL
13 MalId int 13 TotalEpisodes int `json:"total_episodes"` // If provided by the API
14 AnilistId int 14 MalId int `json:"mal_id"`
15 AllanimeId string 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"`
16} 22}
17 23
18type SkipTimes struct { 24type SkipTimes struct {
19 Op int 25 Op Skip `json:"op"`
20 Ed int 26 Ed Skip `json:"ed"`
21} 27}
22 28
23type Episode struct { 29type Episode struct {
24 Tit AnimeTitle 30 Title AnimeTitle `json:"title"`
25 Number int 31 Number int `json:"number"`
26 Skip_times SkipTimes 32 SkipTimes SkipTimes `json:"skip_times"`
27 Player playingVideo 33 Player playingVideo `json:"player"`
28 Links []string 34 Resume bool `json:"resume"`
29 Is_filler bool 35 Started bool `json:"started"`
30 Is_recap bool 36 Duration int `json:"duration"`
31 Aired string 37 Links []string `json:"links"`
32 Synopsis string 38 IsFiller bool `json:"filler"`
39 IsRecap bool `json:"recap"`
40 Aired string `json:"aired"`
41 Synopsis string `json:"synopsis"`
33} 42}
34 43
35type playingVideo struct { 44type playingVideo struct {
36 Url string 45 Url string
37 Speed float64 46 Speed float64 `json:"speed"`
38 PlaybackTime int 47 PlaybackTime int `json:"playback_time"`
39} 48}
40 49
41type User struct { 50type User struct {