aboutsummaryrefslogtreecommitdiff
path: root/mal
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-30 00:17:26 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-30 00:17:26 +0530
commitaf8701225a83e0521b6f5e5c68aab6b4f0809749 (patch)
tree09bd33351c8dc4e73252c806f6efb7900cb4c07a /mal
parent787860249267d96f6100415183afc07959dc9048 (diff)
added confirmation message and color coding when setting anime status
Diffstat (limited to 'mal')
-rw-r--r--mal/status.go24
1 files changed, 6 insertions, 18 deletions
diff --git a/mal/status.go b/mal/status.go
index 4a581df..c3866eb 100644
--- a/mal/status.go
+++ b/mal/status.go
@@ -21,36 +21,24 @@ package mal
import (
"fmt"
"os"
+ a "github.com/MikunoNaka/MAL2Go/v2/user/anime"
+ m "github.com/MikunoNaka/MAL2Go/v2/user/manga"
)
-func SetAnimeStatus(animeId int, status string) {
+func SetAnimeStatus(animeId int, status string) a.UpdateResponse {
resp, err := userAnimeClient.SetStatus(animeId, status)
if err != nil {
fmt.Println("Error while parsing status:", err.Error())
os.Exit(1)
}
- // TODO: do something with resp
- fmt.Println(resp)
-
- // not needed with MAL2Go v2.... probably
- // if resp.Error != "" {
- // fmt.Println("MyAnimeList reported error on setting anime status", resp.Error, resp.Message)
- // os.Exit(1)
- // }
+ return resp
}
-func SetMangaStatus(mangaId int, status string) {
+func SetMangaStatus(mangaId int, status string) m.UpdateResponse {
resp, err := userMangaClient.SetStatus(mangaId, status)
if err != nil {
fmt.Println("Error while parsing status:", err.Error())
os.Exit(1)
}
- // TODO: do something with resp
- fmt.Println(resp)
-
- // not needed with MAL2Go v2.... probably
- // if resp.Error != "" {
- // fmt.Println("MyAnimeList reported error on setting manga status", resp.Error, resp.Message)
- // os.Exit(1)
- // }
+ return resp
}