mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-14 05:39:52 +01:00
MAL progress fetch
This commit is contained in:
16
knecht.go
16
knecht.go
@@ -72,16 +72,16 @@ func GetAnimeDetailData(animeId int64) (*Anime, []byte, error) {
|
||||
|
||||
func GetUserAnimeListData(username, status string) (*AnimeListMal, []byte, error) {
|
||||
var list AnimeListMal
|
||||
body, err := GetUserAnimeListBytes(username, status)
|
||||
data, err := animeListCache.Get(username + status)
|
||||
if err != nil {
|
||||
return nil, body, err
|
||||
data, err = GetDataMal(userApiMal + username + "/animelist?limit=1000&status=" + status + "&fields=list_status")
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
animeListCache.Set(username+status, data)
|
||||
}
|
||||
err = json.Unmarshal(body, &list)
|
||||
return &list, body, err
|
||||
}
|
||||
|
||||
func GetUserAnimeListBytes(username, status string) ([]byte, error) {
|
||||
return GetDataMal(userApiMal + username + "/animelist?limit=1000&status=" + status)
|
||||
err = json.Unmarshal(data, &list)
|
||||
return &list, data, err
|
||||
}
|
||||
|
||||
func GetUserData(username string) (*User, []byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user