anitrack/AniListTypes.go

153 lines
4.4 KiB
Go

package main
type AniListJWT struct {
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
type AniListUser struct {
Data struct {
Viewer struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"Viewer"`
} `json:"data"`
}
type AniListCurrentUserWatchList struct {
Data struct {
Page struct {
PageInfo struct {
Total int `json:"total"`
PerPage int `json:"perPage"`
CurrentPage int `json:"currentPage"`
LastPage int `json:"lastPage"`
HasNextPage bool `json:"hasNextPage"`
} `json:"pageInfo"`
MediaList []MediaList `json:"mediaList"`
} `json:"Page"`
} `json:"data"`
}
type AniListGetSingleAnime struct {
Data struct {
MediaList MediaList `json:"MediaList"`
} `json:"data"`
}
type MediaList struct {
ID int `json:"id"`
MediaID int `json:"mediaId"`
UserID int `json:"userId"`
Media struct {
ID int `json:"id"`
IDMal int `json:"idMal"`
Title struct {
Romaji string `json:"romaji"`
English string `json:"english"`
Native string `json:"native"`
} `json:"title"`
Description string `json:"description"`
CoverImage struct {
Large string `json:"large"`
} `json:"coverImage"`
Season string `json:"season"`
SeasonYear int `json:"seasonYear"`
Status string `json:"status"`
Episodes int `json:"episodes"`
NextAiringEpisode struct {
AiringAt int `json:"airingAt"`
TimeUntilAiring int `json:"timeUntilAiring"`
Episode int `json:"episode"`
} `json:"nextAiringEpisode"`
} `json:"media"`
Status string `json:"status"`
Notes string `json:"notes"`
Progress int `json:"progress"`
Score int `json:"score"`
Repeat int `json:"repeat"`
User struct {
ID int `json:"id"`
Name string `json:"name"`
Avatar struct {
Large string `json:"large"`
Medium string `json:"medium"`
} `json:"avatar"`
Statistics struct {
Anime struct {
Count int `json:"count"`
Statuses []struct {
Status string `json:"status"`
Count int `json:"count"`
} `json:"statuses"`
} `json:"anime"`
} `json:"statistics"`
} `json:"user"`
}
var MediaListSort = struct {
MediaId string
MediaIdDesc string
Score string
ScoreDesc string
Status string
StatusDesc string
Progress string
ProgressDesc string
ProgressVolumes string
ProgressVolumesDesc string
Repeat string
RepeatDesc string
Priority string
PriorityDesc string
StartedOn string
StartedOnDesc string
FinishedOn string
FinishedOnDesc string
AddedTime string
AddedTimeDesc string
UpdatedTime string
UpdatedTimeDesc string
MediaTitleRomaji string
MediaTitleRomajiDesc string
MediaTitleEnglish string
MediaTitleEnglishDesc string
MediaTitleNative string
MediaTitleNativeDesc string
MediaPopularity string
MediaPopularityDesc string
}{
MediaId: "MEDIA_ID",
MediaIdDesc: "MEDIA_ID_DESC",
Score: "SCORE",
ScoreDesc: "SCORE_DESC",
Status: "STATUS",
StatusDesc: "STATUS_DESC",
Progress: "PROGRESS",
ProgressDesc: "PROGRESS_DESC",
ProgressVolumes: "PROGRESS_VOLUMES",
ProgressVolumesDesc: "PROGRESS_VOLUMES_DESC",
Repeat: "REPEAT",
RepeatDesc: "REPEAT_DESC",
Priority: "PRIORITY",
PriorityDesc: "PRIORITY_DESC",
StartedOn: "STARTED_ON",
StartedOnDesc: "STARTED_ON_DESC",
FinishedOn: "FINISHED_ON",
FinishedOnDesc: "FINISHED_ON_DESC",
AddedTime: "ADDED_TIME",
AddedTimeDesc: "ADDED_TIME_DESC",
UpdatedTime: "UPDATED_TIME",
UpdatedTimeDesc: "UPDATED_TIME_DESC",
MediaTitleRomaji: "MEDIA_TITLE_ROMAJI",
MediaTitleRomajiDesc: "MEDIA_TITLE_ROMAJI_DESC",
MediaTitleEnglish: "MEDIA_TITLE_ENGLISH",
MediaTitleEnglishDesc: "MEDIA_TITLE_ENGLISH_DESC",
MediaTitleNative: "MEDIA_TITLE_NATIVE",
MediaTitleNativeDesc: "MEDIA_TITLE_NATIVE_DESC",
MediaPopularity: "MEDIA_POPULARITY",
MediaPopularityDesc: "MEDIA_POPULARITY_DESC",
}