From e143dc8955de158365e193882cb1b881abaa2d94 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Mon, 4 Jul 2022 01:04:20 +0530 Subject: migrating from MAL2Go v2 to v3 --- mal/data.go | 4 ++-- mal/delete.go | 4 ++-- mal/episodes.go | 4 ++-- mal/mal.go | 11 ++++++----- mal/score.go | 4 ++-- mal/search.go | 8 ++++---- mal/status.go | 4 ++-- mal/user.go | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) (limited to 'mal') 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 . package mal import ( - u "github.com/MikunoNaka/MAL2Go/v2/user" + u "github.com/MikunoNaka/MAL2Go/v3/user" "fmt" "os" ) -- cgit v1.2.3