Skip to content

Commit

Permalink
fix genres
Browse files Browse the repository at this point in the history
  • Loading branch information
desujoy committed Oct 7, 2023
1 parent 521cada commit 7707fc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ app.get("/", async (req, res) => {
const random = Math.floor(Math.random() * list.length);
const response = await axios.get(MAL_URL + 'anime/' + list[random].id + MAL_FIELDS, MAL_HEADER);
const data = response.data;
console.log(data);
const genres = data.genres.map((genre) => genre.name);
const anime = {
title: data.title,
poster: data.main_picture.large,
genre: data.genres[0].name,
genre: genres,
synopsis: data.synopsis,
rating: data.mean,
status: data.status,
Expand Down
1 change: 1 addition & 0 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<div class="anime-details">
<strong>Name:</strong> <%= data.title %><br />
<strong>Rating:</strong> <%= data.rating %><br />
<strong>Genres:</strong> <%= data.genre %><br />
<strong>Episodes:</strong> <%= data.episodeCount %><br />
<strong>Status:</strong> <%= data.status %><br />
<strong>Synopsis:</strong> <%= data.synopsis %><br />
Expand Down

0 comments on commit 7707fc6

Please sign in to comment.