diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-07-04 16:45:14 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-07-04 16:45:14 +0530 |
commit | 2051cb36d0153b7ab5aaa15e0c700047560ca7a9 (patch) | |
tree | 0bd160141d17a63df92e47079946795dd51946d8 /mal/search.go | |
parent | 1cac547f4aa9d15a56281c4b5a9db5e8f3d97c47 (diff) |
formatted anime info showed when searching anime
Diffstat (limited to 'mal/search.go')
-rw-r--r-- | mal/search.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/mal/search.go b/mal/search.go index 32df60f..e1c8166 100644 --- a/mal/search.go +++ b/mal/search.go @@ -25,15 +25,8 @@ import ( m "github.com/MikunoNaka/MAL2Go/v3/manga" ) -func SearchAnime(searchString string) []a.Anime { - fields := []string{ - "title", "id", "num_episodes", - "synopsis", "alternative_titles", - "start_date", "end_date", "mean", - "start_season", "rank", "media_type", - "status", "average_episode_duration", - "rating", "studios", - } +func SearchAnime(searchString string, fields []string) []a.Anime { + fields = append([]string{"title", "id"}, fields...) res, err := animeClient.SearchAnime(searchString, SearchLength, SearchOffset, SearchNSFW, fields) if err != nil { @@ -44,8 +37,8 @@ func SearchAnime(searchString string) []a.Anime { return res } -func SearchManga(searchString string) []m.Manga { - fields := []string{"title", "id", "my_list_status"} +func SearchManga(searchString string, fields []string) []m.Manga { + fields = append([]string{"title", "id"}, fields...) res, err := mangaClient.SearchManga(searchString, SearchLength, SearchOffset, SearchNSFW, fields) if err != nil { |