aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-30 21:32:30 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-30 21:32:30 +0530
commit05f7943ee7267e305d40be8afc2e404421ee5742 (patch)
tree183c55a3511dd373f701f38affa2cc9b3699f051
parent28b52bfddc5ad4802efdf82a75618e27eb1b3e36 (diff)
Bug fix: sometimes macli status command printing 'not in list' because of MAL API not sending list data with SearchAnime
-rw-r--r--cmd/status.go6
-rw-r--r--cmd/version.go4
2 files changed, 6 insertions, 4 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)
diff --git a/cmd/version.go b/cmd/version.go
index 6baf737..cc40407 100644
--- a/cmd/version.go
+++ b/cmd/version.go
@@ -23,14 +23,14 @@ import (
"github.com/spf13/cobra"
)
-var version string = "v1.4.0"
+var version string = "v1.4.1"
var versionCmd = &cobra.Command {
Use: "version",
Short: "Shows current version",
Long: "Shows current version of macli",
Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("macli ", version)
+ fmt.Println("macli", version)
},
}