aboutsummaryrefslogtreecommitdiff
path: root/mal
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 /mal
parentbd0da056a9f4c1246ad5a980b1c824b7382478cf (diff)
migrating from MAL2Go v2 to v3
Diffstat (limited to 'mal')
-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
8 files changed, 21 insertions, 20 deletions
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"
)