From bd0da056a9f4c1246ad5a980b1c824b7382478cf Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 3 Jul 2022 22:57:06 +0530 Subject: dynamically handling prompt length, search length, offset, etc --- mal/search.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'mal/search.go') diff --git a/mal/search.go b/mal/search.go index 8fee461..5add67f 100644 --- a/mal/search.go +++ b/mal/search.go @@ -26,11 +26,9 @@ import ( ) func SearchAnime(searchString string) []a.Anime { - // TODO: read limit, offset from flags - limit, offset := 10, 0 fields := []string{"title", "id", "my_list_status"} - res, err := animeClient.SearchAnime(searchString, limit, offset, fields) + res, err := animeClient.SearchAnime(searchString, SearchLength, SearchOffset, fields) if err != nil { fmt.Println("MyAnimeList reported error while searching:", err.Error()) os.Exit(1) @@ -40,11 +38,9 @@ func SearchAnime(searchString string) []a.Anime { } func SearchManga(searchString string) []m.Manga { - // TODO: read limit, offset from flags - limit, offset := 10, 0 fields := []string{"title", "id", "my_list_status"} - res, err := mangaClient.SearchManga(searchString, limit, offset, fields) + res, err := mangaClient.SearchManga(searchString, SearchLength, SearchOffset, fields) if err != nil { fmt.Println("MyAnimeList reported error while searching:", err.Error()) os.Exit(1) -- cgit v1.2.3