Skip to content

Commit

Permalink
removed null items
Browse files Browse the repository at this point in the history
  • Loading branch information
pirateIV committed Aug 24, 2023
1 parent 4af08ad commit fcf3df5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion html/movie.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<title>0</title>

<link rel="stylesheet" href="../css/main.css" />
<link rel="stylesheet" href="../css/index.css">
Expand Down
2 changes: 1 addition & 1 deletion html/pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2 class="cast-name text-white"></h2>
<a href="" class="text-white"
><img width="20" src="../icon/instagram.256x256.png" alt=""></i
></a> -->
<a id="imdbPage" class="text-dark"><img width="20" src="../icon/imdb_5977585.png" alt=""></i></a>
<a id="imdbPage" class="text-dark" target="_blank"><img width="20" src="../icon/imdb_5977585.png" alt=""></i></a>
</div>
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions js/movies.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ async function getMovieDetails(mov_detail_id) {

// Get Movie Credits
const creditData = await getMovieCredits(id);
console.log(creditData);
console.log(creditData.cast);
console.log(creditData.cast);

const cast = creditData.cast;
const crew = creditData.crew;
const cast = creditData.cast.filter(cst => cst.profile_path !== null);
const crew = creditData.crew.filter(cst => cst.profile_path !== null);
console.log(crew, cast)

// find the director for each movie
const director = crew.find((member) => member.job === "Director");
Expand Down Expand Up @@ -208,9 +210,8 @@ async function getMovieDetails(mov_detail_id) {
<h1 class="text-white mt-3">Cast</h1>
<section class="casts d-flex gap-5 overflow-scroll overflow-hidden position-relative" style="width: 90vw; height: 50vh">
<div class="d-flex flex-row gap-4 text-center">
${creditData.cast
.filter((cst) => cst.profile_path !== null)
.map(
${cast
.forEach(
(cst, index) =>
`<div class="cast-img rounded-2">
<div>
Expand Down Expand Up @@ -238,10 +239,9 @@ async function getMovieDetails(mov_detail_id) {
<h1 class="text-white">Crew</h1>
<section class="casts d-flex gap-5 overflow-scroll overflow-hidden position-relative" style="width: 90vw; height: 50vh">
<div class="d-flex flex-row gap-4 text-center">
${creditData.crew
.filter((cst) => cst.profile_path !== null)
.map(
(cst) => `
${crew
.forEach(
(cst, index) => `
<div class="cast-img rounded-2">
<div>
<img src="${
Expand Down

0 comments on commit fcf3df5

Please sign in to comment.