aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-07-04 21:09:54 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-07-04 21:09:54 +0530
commita8c3e33462bc295bd727e39364cfd26e4aa4ea4d (patch)
treeb8caaaac4a661cca819270b5d88b997ea4572c19 /ui
parent4879f9849d224849cd9118a68f079bbd917b2b14 (diff)
added --id flag to search and status commands
Diffstat (limited to 'ui')
-rw-r--r--ui/status.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/status.go b/ui/status.go
index c3d16e7..f5425b4 100644
--- a/ui/status.go
+++ b/ui/status.go
@@ -77,8 +77,11 @@ func FormatStatus(status string) string {
}
// very short name I know
-func CreateStatusUpdateConfirmationMessage(title, status string) string {
- return "Set \x1b[35m" + title + "\x1b[0m status to " + GetColorCodeByStatus(status) + FormatStatus(status) + "\x1b[0m"
+func CreateStatusUpdateConfirmationMessage(title, status, prevStatus string) string {
+ if prevStatus != "" {
+ return fmt.Sprintf("\x1b[35m%s\x1b[0m Status :: %s%s\x1b[0m -> %s%s\x1b[0m", title, GetColorCodeByStatus(status), FormatStatus(status), GetColorCodeByStatus(prevStatus), FormatStatus(prevStatus))
+ }
+ return "\x1b[35m" + title + "\x1b[0m Status :: " + GetColorCodeByStatus(status) + FormatStatus(status) + "\x1b[0m"
}
func AnimeStatusMenu(anime a.Anime) {
@@ -134,7 +137,7 @@ func AnimeStatusMenu(anime a.Anime) {
}
resp := mal.SetAnimeStatus(anime.Id, options[res].Status)
- fmt.Println(CreateStatusUpdateConfirmationMessage(anime.Title, resp.Status))
+ fmt.Println(CreateStatusUpdateConfirmationMessage(anime.Title, resp.Status, anime.MyListStatus.Status))
}
func MangaStatusMenu(manga m.Manga) {
@@ -190,5 +193,5 @@ func MangaStatusMenu(manga m.Manga) {
}
resp := mal.SetMangaStatus(manga.Id, options[res].Status)
- fmt.Println(CreateStatusUpdateConfirmationMessage(manga.Title, resp.Status))
+ fmt.Println(CreateStatusUpdateConfirmationMessage(manga.Title, resp.Status, manga.MyListStatus.Status))
}