mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-15 19:49:53 +01:00
Anime lists didn't age well 😵💫
This commit is contained in:
16
schaffer.go
16
schaffer.go
@@ -194,9 +194,9 @@ func SearchAppointments(animeId int64) ([]Appointment, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func FetchProgress(animeId int64, username string, refetch bool) (int, time.Time, int, string, error) {
|
||||
func FetchProgress(animeId int64, username string) (int, time.Time, int, string, error) {
|
||||
// check watching first
|
||||
newProgress, updated, score, err := FetchProgressOnState(animeId, username, malApiStatusW, refetch)
|
||||
newProgress, updated, score, err := FetchProgressOnState(animeId, username, malApiStatusW)
|
||||
if err != nil {
|
||||
return newProgress, updated, score, "", err
|
||||
}
|
||||
@@ -204,7 +204,7 @@ func FetchProgress(animeId int64, username string, refetch bool) (int, time.Time
|
||||
return newProgress, updated, score, malApiStatusW, err
|
||||
}
|
||||
// check completed
|
||||
newProgress, updated, score, err = FetchProgressOnState(animeId, username, malApiStatusC, refetch)
|
||||
newProgress, updated, score, err = FetchProgressOnState(animeId, username, malApiStatusC)
|
||||
if err != nil {
|
||||
return newProgress, updated, score, "", err
|
||||
}
|
||||
@@ -212,7 +212,7 @@ func FetchProgress(animeId int64, username string, refetch bool) (int, time.Time
|
||||
return newProgress, updated, score, malApiStatusC, err
|
||||
}
|
||||
// check on hold
|
||||
newProgress, updated, score, err = FetchProgressOnState(animeId, username, malApiStatusH, refetch)
|
||||
newProgress, updated, score, err = FetchProgressOnState(animeId, username, malApiStatusH)
|
||||
if err != nil {
|
||||
return newProgress, updated, score, "", err
|
||||
}
|
||||
@@ -220,7 +220,7 @@ func FetchProgress(animeId int64, username string, refetch bool) (int, time.Time
|
||||
return newProgress, updated, score, malApiStatusH, err
|
||||
}
|
||||
// check dropped
|
||||
newProgress, updated, score, err = FetchProgressOnState(animeId, username, malApiStatusD, refetch)
|
||||
newProgress, updated, score, err = FetchProgressOnState(animeId, username, malApiStatusD)
|
||||
if err != nil {
|
||||
return newProgress, updated, score, "", err
|
||||
}
|
||||
@@ -231,8 +231,8 @@ func FetchProgress(animeId int64, username string, refetch bool) (int, time.Time
|
||||
return 0, updated, 0, "", nil
|
||||
}
|
||||
|
||||
func FetchProgressOnState(animeId int64, username, malStatus string, refetch bool) (int, time.Time, int, error) {
|
||||
list, _, err := GetUserAnimeListData(username, malStatus, refetch)
|
||||
func FetchProgressOnState(animeId int64, username, malStatus string) (int, time.Time, int, error) {
|
||||
list, _, err := GetUserAnimeListData(username, malStatus)
|
||||
if err != nil {
|
||||
return 0, time.Time{}, 0, err
|
||||
}
|
||||
@@ -327,7 +327,7 @@ func BuildMovieCharts() ([]MovieChart, error) {
|
||||
|
||||
scoreSum := 0
|
||||
for _, u := range users {
|
||||
progress, _, score, err := FetchProgressOnState(c.Anime, u.Username, malApiStatusC, false)
|
||||
progress, _, score, err := FetchProgressOnState(c.Anime, u.Username, malApiStatusC)
|
||||
if err != nil {
|
||||
color.Errorln(err.Error())
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user