aboutsummaryrefslogtreecommitdiff
path: root/mal/score.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-08-15 10:57:27 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-08-15 10:57:27 +0530
commitfff3dadabc321871e6819392efc605c6dffe2e69 (patch)
tree25aceed23b73b2ad975a06d73fad091d0886a2a6 /mal/score.go
parenta44d6eb2fdddc75983c735e1a0fa744014db9593 (diff)
migrated from MAL2Go to mg package
Diffstat (limited to 'mal/score.go')
-rw-r--r--mal/score.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/mal/score.go b/mal/score.go
index 2db6000..c641302 100644
--- a/mal/score.go
+++ b/mal/score.go
@@ -19,23 +19,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package mal
import (
+ "vidhukant.com/mg"
"fmt"
- a "github.com/MikunoNaka/MAL2Go/v4/user/anime"
- m "github.com/MikunoNaka/MAL2Go/v4/user/manga"
)
-func SetAnimeScore(animeId, score int) a.UpdateResponse {
- resp, err := userAnimeClient.SetScore(animeId, score)
+func SetAnimeScore(animeId, score int) mg.AnimeUpdateResponse {
+ var res mg.AnimeUpdateResponse
+ err := MALClient.UpdateAnime(&res, animeId, map[string]interface{}{mg.Score: score})
if err != nil {
fmt.Println("MyAnimeList returned error while updating anime score:", err)
}
- return resp
+ return res
}
-func SetMangaScore(mangaId, score int) m.UpdateResponse {
- resp, err := userMangaClient.SetScore(mangaId, score)
+func SetMangaScore(mangaId, score int) mg.MangaUpdateResponse {
+ var res mg.MangaUpdateResponse
+ err := MALClient.UpdateManga(&res, mangaId, map[string]interface{}{mg.Score: score})
if err != nil {
fmt.Println("MyAnimeList returned error while updating manga score:", err)
}
- return resp
+ return res
}