diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-07-06 22:33:57 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-07-06 22:33:57 +0530 |
commit | d7457e783bdd62f64df4791634c0705805b0ff62 (patch) | |
tree | 77222a7f79e11853ce35b54bcb7f435d21b51586 /user | |
parent | 5417321dcf8d789652028f8013d71f10d7b5a8fa (diff) |
Bug Fix: added nsfw option to GetAnimeList and GetMangaList
Diffstat (limited to 'user')
-rw-r--r-- | user/anime/animelist.go | 10 | ||||
-rw-r--r-- | user/manga/mangalist.go | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/user/anime/animelist.go b/user/anime/animelist.go index b950012..6c8453c 100644 --- a/user/anime/animelist.go +++ b/user/anime/animelist.go @@ -38,7 +38,7 @@ func (c Client)DeleteAnime(id int) (string, error) { // Get authenticated user's anime list // returns true as second value if there are more animes present -func (c Client) GetAnimeList(user, status, sort string, limit, offset int, fields []string) ([]a.Anime, bool, error){ +func (c Client) GetAnimeList(user, status, sort string, limit, offset int, nsfw bool, fields []string) ([]a.Anime, bool, error){ var userAnimeList []a.Anime // error handling for limit limitErr := e.LimitErrHandler(limit, maxListLimit) @@ -75,16 +75,16 @@ func (c Client) GetAnimeList(user, status, sort string, limit, offset int, field if status == "" { endpoint, _ = u.UrlGenerator( BASE_URL + "/users/" + user + "/animelist", - []string{"sort", "limit", "offset", "fields"}, - [][]string{{sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields}, + []string{"sort", "limit", "offset", "fields", "nsfw"}, + [][]string{{sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields, {strconv.FormatBool(nsfw)}}, true, ) } else { // status gets included if specified endpoint, _ = u.UrlGenerator( BASE_URL + "/users/" + user + "/animelist", - []string{"status", "sort", "limit", "offset", "fields"}, - [][]string{{status}, {sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields}, + []string{"status", "sort", "limit", "offset", "fields", "nsfw"}, + [][]string{{status}, {sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields, {strconv.FormatBool(nsfw)}}, true, ) } diff --git a/user/manga/mangalist.go b/user/manga/mangalist.go index cde1ede..8408bde 100644 --- a/user/manga/mangalist.go +++ b/user/manga/mangalist.go @@ -38,7 +38,7 @@ func (c Client)DeleteManga(id int) (string, error) { // Get authenticated user's manga list // returns true as second value if there are more mangas present -func (c Client) GetMangaList(user, status, sort string, limit, offset int, fields []string) ([]m.Manga, bool, error){ +func (c Client) GetMangaList(user, status, sort string, limit, offset int, nsfw bool, fields []string) ([]m.Manga, bool, error){ var userMangaList []m.Manga // error handling for limit limitErr := e.LimitErrHandler(limit, maxListLimit) @@ -75,16 +75,16 @@ func (c Client) GetMangaList(user, status, sort string, limit, offset int, field if status == "" { endpoint, _ = u.UrlGenerator( BASE_URL + "/users/" + user + "/mangalist", - []string{"sort", "limit", "offset", "fields"}, - [][]string{{sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields}, + []string{"sort", "limit", "offset", "fields", "nsfw"}, + [][]string{{sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields, {strconv.FormatBool(nsfw)}}, true, ) } else { // status gets included if specified endpoint, _ = u.UrlGenerator( BASE_URL + "/users/" + user + "/mangalist", - []string{"status", "sort", "limit", "offset", "fields"}, - [][]string{{status}, {sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields}, + []string{"status", "sort", "limit", "offset", "fields", "nsfw"}, + [][]string{{status}, {sort}, {strconv.Itoa(limit)}, {strconv.Itoa(offset)}, fields, {strconv.FormatBool(nsfw)}}, true, ) } |