diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-30 21:32:30 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-30 21:32:30 +0530 |
commit | 05f7943ee7267e305d40be8afc2e404421ee5742 (patch) | |
tree | 183c55a3511dd373f701f38affa2cc9b3699f051 /cmd/status.go | |
parent | 28b52bfddc5ad4802efdf82a75618e27eb1b3e36 (diff) |
Bug fix: sometimes macli status command printing 'not in list' because of MAL API not sending list data with SearchAnime
Diffstat (limited to 'cmd/status.go')
-rw-r--r-- | cmd/status.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/status.go b/cmd/status.go index d79d5a6..6a23bfd 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -73,9 +73,10 @@ func setAnimeStatus(statusInput, searchInput string) { } anime := ui.AnimeSearch("Select Anime:", searchInput) + selectedAnime := mal.GetAnimeData(anime.Id, []string{"my_list_status"}) if queryOnlyMode { - status := anime.MyListStatus.Status + status := selectedAnime.MyListStatus.Status // fmt.Printf("Anime: \x1b[35m%s\x1b[0m, Status: %s%s\x1b[0m\n", anime.Title, ui.GetColorCodeByStatus(status), ui.FormatStatus(status)) fmt.Printf("\x1b[35m%s\x1b[0m :: %s%s\x1b[0m\n", anime.Title, ui.GetColorCodeByStatus(status), ui.FormatStatus(status)) os.Exit(0) @@ -101,9 +102,10 @@ func setMangaStatus(statusInput, searchInput string) { } manga := ui.MangaSearch("Select Manga:", searchInput) + selectedManga := mal.GetAnimeData(manga.Id, []string{"my_list_status"}) if queryOnlyMode { - status := manga.MyListStatus.Status + status := selectedManga.MyListStatus.Status // fmt.Printf("Manga: \x1b[35m%s\x1b[0m, Status: %s%s\x1b[0m\n", manga.Title, ui.GetColorCodeByStatus(status), ui.FormatStatus(status)) fmt.Printf("\x1b[35m%s\x1b[0m :: %s%s\x1b[0m\n", manga.Title, ui.GetColorCodeByStatus(status), ui.FormatStatus(status)) os.Exit(0) |