diff options
| author | real-zephex <[email protected]> | 2024-05-08 10:13:36 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-08 10:13:36 +0530 |
| commit | 5dcca245b34037eb15505ffd1d1b23213bedad9c (patch) | |
| tree | feb9a8d943a7c91076d5ff691fba653dc5b4d36c /src/app/movies | |
| parent | Delete .github/workflows/eslint.yml (diff) | |
| parent | minor css fixes and added a new source for movies (diff) | |
| download | dramalama-5dcca245b34037eb15505ffd1d1b23213bedad9c.tar.xz dramalama-5dcca245b34037eb15505ffd1d1b23213bedad9c.zip | |
Merge pull request #22 from zephex-alt/master
New movie source - autoembed.cc
Diffstat (limited to 'src/app/movies')
| -rw-r--r-- | src/app/movies/components/search_2.jsx | 80 | ||||
| -rw-r--r-- | src/app/movies/components/video_player.jsx | 9 | ||||
| -rw-r--r-- | src/app/movies/styles/info.module.css | 2 | ||||
| -rw-r--r-- | src/app/movies/styles/search.module.css | 5 |
4 files changed, 58 insertions, 38 deletions
diff --git a/src/app/movies/components/search_2.jsx b/src/app/movies/components/search_2.jsx index 82bba52..cf3fc69 100644 --- a/src/app/movies/components/search_2.jsx +++ b/src/app/movies/components/search_2.jsx @@ -9,43 +9,49 @@ import styles from "../styles/search.module.css"; const SearchResults = async (title) => { const data = await get_search_results(title); PreFetchMovieInfo(data); - return ( - <div className={styles.MovieSearchResultsContainer}> - {data && - data.results && - data.results.map((item, index) => { - if (item.poster_path) { - return ( - <Link - href={`/movies/${item.id}`} - key={index} - style={{ - backgroundImage: `url(https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=https://image.tmdb.org/t/p/original${item.backdrop_path})`, - backgroundRepeat: "no-repeat", - backgroundSize: "cover", - textDecoration: "none", - color: "white", - borderRadius: "0.5rem", - overflow: "hidden", - }} - className={styles.MovieResultsPrev} - > - <section className={styles.MovieEntry}> - <p>{item.title || item.original_title}</p> - <Image - src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=https://image.tmdb.org/t/p/original${item.poster_path}`} - width={150} - height={230} - alt="Movie Poster" - priority - /> - </section> - </Link> - ); - } - })} - </div> - ); + if (data.results.length > 0) { + return ( + <div className={styles.MovieSearchResultsContainer}> + {data && + data.results && + data.results.map((item, index) => { + if (item.poster_path) { + return ( + <Link + href={`/movies/${item.id}`} + key={index} + style={{ + backgroundImage: `url(https://image.tmdb.org/t/p/original${item.backdrop_path})`, + backgroundRepeat: "no-repeat", + backgroundSize: "cover", + textDecoration: "none", + color: "white", + borderRadius: "0.5rem", + overflow: "hidden", + }} + className={styles.MovieResultsPrev} + > + <section className={styles.MovieEntry}> + <p> + {item.title || item.original_title} + </p> + <Image + src={`https://image.tmdb.org/t/p/original${item.poster_path}`} + width={130} + height={230} + alt="Movie Poster" + priority + /> + </section> + </Link> + ); + } + })} + </div> + ); + } else { + return <p className={styles.NoResults}>No results found!</p>; + } }; const get_search_results = async (title) => { diff --git a/src/app/movies/components/video_player.jsx b/src/app/movies/components/video_player.jsx index a808ea3..86ff8e5 100644 --- a/src/app/movies/components/video_player.jsx +++ b/src/app/movies/components/video_player.jsx @@ -52,6 +52,15 @@ export default function VIDEO_PLAYER({ id: id }) { > Vidsrc.icu </button> + <button + onClick={() => + make_player( + `https://player.autoembed.cc/embed/movie/${id}` + ) + } + > + Autoembded.cc + </button> </div> {frame} </section> diff --git a/src/app/movies/styles/info.module.css b/src/app/movies/styles/info.module.css index bc3b30a..a0da8d9 100644 --- a/src/app/movies/styles/info.module.css +++ b/src/app/movies/styles/info.module.css @@ -20,7 +20,7 @@ .HeroSection img { border-radius: 1rem; - padding: 0.5rem; + padding: 0.5rem 0 0 0; } .HeroTitle { diff --git a/src/app/movies/styles/search.module.css b/src/app/movies/styles/search.module.css index 66b6046..ea81e3f 100644 --- a/src/app/movies/styles/search.module.css +++ b/src/app/movies/styles/search.module.css @@ -69,6 +69,11 @@ font-size: 18px; } +.NoResults { + color: white; + text-align: center; +} + @media screen and (max-width: 768px) { .InputContainer { width: 100%; |