aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-07-04 01:04:20 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-07-04 01:04:20 +0530
commite143dc8955de158365e193882cb1b881abaa2d94 (patch)
treeaf251368ac96fd9517932468ed29631371b4c106
parentbd0da056a9f4c1246ad5a980b1c824b7382478cf (diff)
migrating from MAL2Go v2 to v3
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--mal/data.go4
-rw-r--r--mal/delete.go4
-rw-r--r--mal/episodes.go4
-rw-r--r--mal/mal.go11
-rw-r--r--mal/score.go4
-rw-r--r--mal/search.go8
-rw-r--r--mal/status.go4
-rw-r--r--mal/user.go2
-rw-r--r--ui/actions.go4
-rw-r--r--ui/episodes.go4
-rw-r--r--ui/score.go4
-rw-r--r--ui/search.go4
-rw-r--r--ui/status.go4
15 files changed, 34 insertions, 33 deletions
diff --git a/go.mod b/go.mod
index b4d95bb..4940cab 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/MikunoNaka/macli
go 1.18
require (
- github.com/MikunoNaka/MAL2Go/v2 v2.0.3
+ github.com/MikunoNaka/MAL2Go/v3 v3.0.1
github.com/manifoldco/promptui v0.9.0
github.com/spf13/cobra v1.4.0
github.com/zalando/go-keyring v0.2.1
diff --git a/go.sum b/go.sum
index d0f59bd..3938248 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/MikunoNaka/MAL2Go/v2 v2.0.3 h1:T3hSc2QL51zi5xZ71l2JwcqO1t7cfFuMvmU9WhOYIlo=
-github.com/MikunoNaka/MAL2Go/v2 v2.0.3/go.mod h1:x+DAqTvsWCuETE7q3ndXvaM4epQ3OJ6QauowQ+ftQFQ=
+github.com/MikunoNaka/MAL2Go/v3 v3.0.1 h1:QYQkBtNRqCk+E+TTfN3Kx/jm6lkFZZf631MnPTnk5PI=
+github.com/MikunoNaka/MAL2Go/v3 v3.0.1/go.mod h1:K8GX5VGSfblL+/6l30CA6US3jIbiwBEpf/n6b/RqKKs=
github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0=
github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30=
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
diff --git a/mal/data.go b/mal/data.go
index 541bd2e..a488413 100644
--- a/mal/data.go
+++ b/mal/data.go
@@ -21,8 +21,8 @@ package mal
import (
"fmt"
"os"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
)
// because MAL2Go/Anime.SearchAnime won't give us all the data sometimes
diff --git a/mal/delete.go b/mal/delete.go
index 863e9f3..5a4abca 100644
--- a/mal/delete.go
+++ b/mal/delete.go
@@ -21,8 +21,8 @@ package mal
import (
"fmt"
// "os"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
)
func DeleteAnime(anime a.Anime) {
diff --git a/mal/episodes.go b/mal/episodes.go
index 22dbae4..56794bb 100644
--- a/mal/episodes.go
+++ b/mal/episodes.go
@@ -21,8 +21,8 @@ package mal
import (
"fmt"
"os"
- a "github.com/MikunoNaka/MAL2Go/v2/user/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/user/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/user/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/user/manga"
"github.com/MikunoNaka/macli/util"
)
diff --git a/mal/mal.go b/mal/mal.go
index 2bc1672..a10d41a 100644
--- a/mal/mal.go
+++ b/mal/mal.go
@@ -20,11 +20,11 @@ package mal
import (
"github.com/MikunoNaka/macli/auth"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
- u "github.com/MikunoNaka/MAL2Go/v2/user"
- ua "github.com/MikunoNaka/MAL2Go/v2/user/anime"
- um "github.com/MikunoNaka/MAL2Go/v2/user/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
+ u "github.com/MikunoNaka/MAL2Go/v3/user"
+ ua "github.com/MikunoNaka/MAL2Go/v3/user/anime"
+ um "github.com/MikunoNaka/MAL2Go/v3/user/manga"
)
var (
@@ -35,6 +35,7 @@ var (
userMangaClient um.Client
SearchLength, SearchOffset int
+ SearchNSFW bool
)
// init() would kill the program prematurely on `macli login` command
diff --git a/mal/score.go b/mal/score.go
index fe52e73..0540192 100644
--- a/mal/score.go
+++ b/mal/score.go
@@ -20,8 +20,8 @@ package mal
import (
"fmt"
- a "github.com/MikunoNaka/MAL2Go/v2/user/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/user/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/user/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/user/manga"
)
func SetAnimeScore(animeId, score int) a.UpdateResponse {
diff --git a/mal/search.go b/mal/search.go
index 5add67f..c010112 100644
--- a/mal/search.go
+++ b/mal/search.go
@@ -21,14 +21,14 @@ package mal
import (
"fmt"
"os"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
)
func SearchAnime(searchString string) []a.Anime {
fields := []string{"title", "id", "my_list_status"}
- res, err := animeClient.SearchAnime(searchString, SearchLength, SearchOffset, fields)
+ res, err := animeClient.SearchAnime(searchString, SearchLength, SearchOffset, SearchNSFW, fields)
if err != nil {
fmt.Println("MyAnimeList reported error while searching:", err.Error())
os.Exit(1)
@@ -40,7 +40,7 @@ func SearchAnime(searchString string) []a.Anime {
func SearchManga(searchString string) []m.Manga {
fields := []string{"title", "id", "my_list_status"}
- res, err := mangaClient.SearchManga(searchString, SearchLength, SearchOffset, fields)
+ res, err := mangaClient.SearchManga(searchString, SearchLength, SearchOffset, SearchNSFW, fields)
if err != nil {
fmt.Println("MyAnimeList reported error while searching:", err.Error())
os.Exit(1)
diff --git a/mal/status.go b/mal/status.go
index c3866eb..e0656ed 100644
--- a/mal/status.go
+++ b/mal/status.go
@@ -21,8 +21,8 @@ package mal
import (
"fmt"
"os"
- a "github.com/MikunoNaka/MAL2Go/v2/user/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/user/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/user/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/user/manga"
)
func SetAnimeStatus(animeId int, status string) a.UpdateResponse {
diff --git a/mal/user.go b/mal/user.go
index f6e9ce7..c720fa1 100644
--- a/mal/user.go
+++ b/mal/user.go
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package mal
import (
- u "github.com/MikunoNaka/MAL2Go/v2/user"
+ u "github.com/MikunoNaka/MAL2Go/v3/user"
"fmt"
"os"
)
diff --git a/ui/actions.go b/ui/actions.go
index 7831fe4..0aebcce 100644
--- a/ui/actions.go
+++ b/ui/actions.go
@@ -23,8 +23,8 @@ import (
"fmt"
"os"
p "github.com/manifoldco/promptui"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
"github.com/MikunoNaka/macli/mal"
)
diff --git a/ui/episodes.go b/ui/episodes.go
index f8ad28a..21c0078 100644
--- a/ui/episodes.go
+++ b/ui/episodes.go
@@ -24,8 +24,8 @@ import (
"os"
"errors"
"github.com/MikunoNaka/macli/mal"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
p "github.com/manifoldco/promptui"
)
diff --git a/ui/score.go b/ui/score.go
index 8555756..2b8a549 100644
--- a/ui/score.go
+++ b/ui/score.go
@@ -25,8 +25,8 @@ import (
"os"
"github.com/MikunoNaka/macli/mal"
"github.com/MikunoNaka/macli/util"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
p "github.com/manifoldco/promptui"
)
diff --git a/ui/search.go b/ui/search.go
index 7ea045a..8e6ac0d 100644
--- a/ui/search.go
+++ b/ui/search.go
@@ -24,8 +24,8 @@ import (
"os"
p "github.com/manifoldco/promptui"
mal "github.com/MikunoNaka/macli/mal"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
)
// only search animes probably only now
diff --git a/ui/status.go b/ui/status.go
index 7a0e538..c3d16e7 100644
--- a/ui/status.go
+++ b/ui/status.go
@@ -23,8 +23,8 @@ import (
"fmt"
"os"
"github.com/MikunoNaka/macli/mal"
- a "github.com/MikunoNaka/MAL2Go/v2/anime"
- m "github.com/MikunoNaka/MAL2Go/v2/manga"
+ a "github.com/MikunoNaka/MAL2Go/v3/anime"
+ m "github.com/MikunoNaka/MAL2Go/v3/manga"
p "github.com/manifoldco/promptui"
)