diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-30 23:20:36 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-30 23:20:36 +0530 |
commit | d28ed19d99f757cd898ee47925bbc9aa4f428125 (patch) | |
tree | 0a93e77866d9bf4539b5f73ebda5b47b3e44e5f8 | |
parent | aa904f5401b8cfcb5f4c4c5d8c0495a4c6c241f7 (diff) |
Bug Fix: search results not showing all required data
-rw-r--r-- | cmd/search.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd/search.go b/cmd/search.go index 89ab17f..63f451a 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -19,11 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. package cmd import ( - "os" "fmt" + "os" "strings" - "github.com/spf13/cobra" + + "github.com/MikunoNaka/macli/mal" "github.com/MikunoNaka/macli/ui" + "github.com/spf13/cobra" ) var searchCmd = &cobra.Command { @@ -57,8 +59,9 @@ func searchManga(searchInput string) { searchInput = ui.TextInput("Search Manga: ", "Search can't be blank.") } manga := ui.MangaSearch("Select Manga:", searchInput) - mangaIsAdded := manga.MyListStatus.Status != "" - ui.MangaActionMenu(mangaIsAdded)(manga) + selectedManga := mal.GetMangaData(manga.Id, []string{"my_list_status", "num_chapters"}) + mangaIsAdded := selectedManga.MyListStatus.Status != "" + ui.MangaActionMenu(mangaIsAdded)(selectedManga) } func searchAnime(searchInput string) { @@ -66,8 +69,9 @@ func searchAnime(searchInput string) { searchInput = ui.TextInput("Search Anime: ", "Search can't be blank.") } anime := ui.AnimeSearch("Select Anime:", searchInput) - animeIsAdded := anime.MyListStatus.Status != "" - ui.AnimeActionMenu(animeIsAdded)(anime) + selectedAnime := mal.GetAnimeData(anime.Id, []string{"my_list_status", "num_episodes"}) + animeIsAdded := selectedAnime.MyListStatus.Status != "" + ui.AnimeActionMenu(animeIsAdded)(selectedAnime) } func init() { |