aboutsummaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/anime/animelist.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/user/anime/animelist.go b/user/anime/animelist.go
index f25a2a2..2099204 100644
--- a/user/anime/animelist.go
+++ b/user/anime/animelist.go
@@ -23,14 +23,13 @@ import (
"errors"
a "github.com/MikunoNaka/mal2go/anime"
e "github.com/MikunoNaka/mal2go/errhandlers"
- u "github.com/MikunoNaka/mal2go/util"
)
const BASE_URL string = "https://api.myanimelist.net/v2"
const maxListLimit int = 1000
// Get authenticated user's anime list
-func (c AnimeListClient) GetAnimeList(user, status, sort string, limit, offset int, fields []string) (a.AnimeList, error){
+func (c AnimeListClient) GetAnimeList(user, status, sort string, limit, offset int) (a.AnimeList, error){
var userAnimeList a.AnimeList
// error handling for limit and offset
limitsErr := e.LimitsErrHandler(limit, offset, maxListLimit)
@@ -38,12 +37,6 @@ func (c AnimeListClient) GetAnimeList(user, status, sort string, limit, offset i
return userAnimeList, limitsErr
}
- // handle all the errors for the fields
- fields, err := e.FieldsErrHandler(fields)
- if err != nil {
- return userAnimeList, err
- }
-
// checks if valid sort is specified
if !e.IsValidListSort(sort) {
return userAnimeList, errors.New(fmt.Sprintf("GetAnimeList: Invalid sort specified: \"%s\"", sort))
@@ -59,12 +52,7 @@ func (c AnimeListClient) GetAnimeList(user, status, sort string, limit, offset i
user = "@me"
}
- endpoint, _ := u.UrlGenerator(
- BASE_URL + "/users/" + user + "/animelist",
- []string{"status", "sort", "limit", "offset", "fields"},
- [][]string{{status}, {sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields},
- true,
- )
+ endpoint := BASE_URL + "/users/" + user + "/animelist?status=" + status + "&sort=" + sort + "&limit=" + strconv.Itoa(limit) + "&offset=" + strconv.Itoa(offset)
// get data from API
var animeListData AnimeListRaw