├── .nvmrc
├── .svelte-kit
├── build
│ ├── hooks.js
│ ├── components
│ │ ├── layout.svelte
│ │ └── error.svelte
│ ├── runtime
│ │ ├── app
│ │ │ ├── paths.js
│ │ │ ├── env.js
│ │ │ ├── navigation.js
│ │ │ └── stores.js
│ │ ├── env.js
│ │ ├── internal
│ │ │ └── singletons.js
│ │ ├── paths.js
│ │ └── chunks
│ │ │ └── utils.js
│ └── generated
│ │ ├── root.svelte
│ │ └── manifest.js
├── dev
│ ├── components
│ │ ├── layout.svelte
│ │ └── error.svelte
│ ├── runtime
│ │ ├── app
│ │ │ ├── paths.js
│ │ │ ├── env.js
│ │ │ ├── stores.js
│ │ │ └── navigation.js
│ │ ├── env.js
│ │ ├── paths.js
│ │ ├── chunks
│ │ │ └── utils.js
│ │ └── internal
│ │ │ └── singletons.js
│ └── generated
│ │ ├── root.svelte
│ │ └── manifest.js
├── output
│ ├── server
│ │ ├── chunks
│ │ │ ├── apiCalls-537263b8.js
│ │ │ ├── NotFound-9fe683d6.js
│ │ │ ├── getMovie-dfbada3a.js
│ │ │ ├── getCast-7cf0533a.js
│ │ │ ├── getKnownFor-737a4ce8.js
│ │ │ ├── getPerson-73622a35.js
│ │ │ ├── getTrailer-b36b5a94.js
│ │ │ ├── getSeason-d3cb4046.js
│ │ │ ├── getShow-6a79cddc.js
│ │ │ ├── getShow-f81111d3.js
│ │ │ ├── getTvGenres-8924ea77.js
│ │ │ ├── getTvGenres-912a2a2a.js
│ │ │ ├── getShowGenre-bece8541.js
│ │ │ ├── getTvNetworks-3869faf2.js
│ │ │ ├── getMovieGenres-3625ddfd.js
│ │ │ ├── getMovieGenres-daf20458.js
│ │ │ ├── getEpisode-3741fea8.js
│ │ │ ├── getSearch-b70547a7.js
│ │ │ ├── stores-bd543f9c.js
│ │ │ ├── ProgressBar-607c37c9.js
│ │ │ ├── [id]-6969a75f.js
│ │ │ ├── index-6445fb8c.js
│ │ │ ├── [media]-0dee69ba.js
│ │ │ ├── __error-7ac6427a.js
│ │ │ ├── [id]-d1cca444.js
│ │ │ ├── store-cc224516.js
│ │ │ ├── [season_number]-873eb4f0.js
│ │ │ ├── [episode_number]-47200495.js
│ │ │ ├── Cast-31f4e4f3.js
│ │ │ ├── [id]-de8563ca.js
│ │ │ └── [id]-8c40f23a.js
│ │ └── app.js
│ ├── client
│ │ └── _app
│ │ │ ├── chunks
│ │ │ ├── singletons-12a22614.js
│ │ │ ├── store-07881416.js
│ │ │ ├── stores-462c50b9.js
│ │ │ ├── ProgressBar-f61e37f1.js
│ │ │ └── Cast-6bfa9e9c.js
│ │ │ ├── assets
│ │ │ ├── start-464e9d0a.css
│ │ │ ├── pages
│ │ │ │ └── __error.svelte-8a5069d9.css
│ │ │ └── Cast-cd25fbf7.css
│ │ │ └── pages
│ │ │ ├── NotFound.svelte-9659fd5f.js
│ │ │ ├── search
│ │ │ └── [id].svelte-63c2cd3f.js
│ │ │ ├── index.svelte-0b7a5c7b.js
│ │ │ ├── trending
│ │ │ └── [media].svelte-40e542c5.js
│ │ │ ├── genre
│ │ │ └── [media]
│ │ │ │ └── [id].svelte-5293c531.js
│ │ │ ├── __error.svelte-1cf9c0b1.js
│ │ │ ├── seasons
│ │ │ └── [id]
│ │ │ │ └── [season_number].svelte-7534c8b0.js
│ │ │ └── episode
│ │ │ └── [id]
│ │ │ └── [season_number]
│ │ │ └── [episode_number].svelte-a1e7498f.js
│ └── manifest.json
└── netlify
│ └── entry.js
├── CNAME
├── .netlify
└── package.json
├── .env example
├── .prettierignore
├── src
├── routes
│ ├── NotFound.svelte
│ ├── api
│ │ ├── getTvNetworks.ts
│ │ ├── getTvGenres.ts
│ │ ├── getMovieGenres.ts
│ │ └── postData.ts
│ ├── episode
│ │ └── [id]
│ │ │ └── [season_number]
│ │ │ └── [episode_number].svelte
│ ├── seasons
│ │ └── [id]
│ │ │ └── [season_number].svelte
│ ├── index.svelte
│ ├── trending
│ │ └── [media].svelte
│ ├── search
│ │ └── [id].svelte
│ ├── __error.svelte
│ ├── genre
│ │ └── [media]
│ │ │ └── [id].svelte
│ ├── person
│ │ └── [id].svelte
│ ├── __layout.svelte
│ ├── movie
│ │ └── [id].svelte
│ └── tv
│ │ └── [id].svelte
├── lib
│ ├── utilities
│ │ ├── PageTransition.svelte
│ │ ├── Skeleton.svelte
│ │ ├── Search.svelte
│ │ ├── MorePages.svelte
│ │ ├── Spinner.svelte
│ │ ├── InfiniteScroll.svelte
│ │ ├── tooltip.ts
│ │ ├── Modal.svelte
│ │ ├── ProgressBar.svelte
│ │ ├── Seasons.svelte
│ │ ├── ToggleDarkMode.svelte
│ │ ├── KnownFor.svelte
│ │ ├── Pagination.svelte
│ │ └── Selector.svelte
│ ├── pages
│ │ ├── TvList.svelte
│ │ ├── MovieList.svelte
│ │ ├── PersonList.svelte
│ │ ├── Season.svelte
│ │ ├── MainSection.svelte
│ │ ├── Person.svelte
│ │ ├── Episode.svelte
│ │ ├── MovieMedia.svelte
│ │ └── TvMedia.svelte
│ ├── components
│ │ ├── PersonCard.svelte
│ │ ├── SeasonTitle.svelte
│ │ ├── PageTitle.svelte
│ │ ├── MovieCard.svelte
│ │ ├── TvCard.svelte
│ │ ├── Cast.svelte
│ │ ├── Header.svelte
│ │ └── Genre.svelte
│ └── stores
│ │ ├── store.ts
│ │ └── theme-store.ts
├── app.html
├── app.css
└── global.d.ts
├── .gitignore
├── static
├── robots.txt
├── default.jpg
├── favicon.ico
├── icons8-moon-60.png
├── icons8-sun-24.png
├── icons8-sun-48.png
├── sun_light_mode_day-512.webp
├── icons8-sun.svg
└── person.svg
├── .prettierrc
├── netlify.toml
├── postcss.config.cjs
├── .eslintrc.cjs
├── svelte.config.js
├── tsconfig.json
├── package.json
├── README.md
└── tailwind.config.cjs
/.nvmrc:
--------------------------------------------------------------------------------
1 | 16.8.0
--------------------------------------------------------------------------------
/.svelte-kit/build/hooks.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | tmdb.athena-designs.com
--------------------------------------------------------------------------------
/.netlify/package.json:
--------------------------------------------------------------------------------
1 | {"type":"commonjs"}
--------------------------------------------------------------------------------
/.env example:
--------------------------------------------------------------------------------
1 | VITE_API_KEY = 999XXX999............
--------------------------------------------------------------------------------
/.svelte-kit/dev/components/layout.svelte:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.svelte-kit/build/components/layout.svelte:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/apiCalls-537263b8.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .svelte/**
2 | static/**
3 | build/**
4 | node_modules/**
5 |
--------------------------------------------------------------------------------
/.svelte-kit/build/runtime/app/paths.js:
--------------------------------------------------------------------------------
1 | export { assets, base } from '../paths.js';
2 |
--------------------------------------------------------------------------------
/.svelte-kit/dev/runtime/app/paths.js:
--------------------------------------------------------------------------------
1 | export { assets, base } from '../paths.js';
2 |
--------------------------------------------------------------------------------
/src/routes/NotFound.svelte:
--------------------------------------------------------------------------------
1 |
This route doesn't exist.
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /.svelte
4 | /build
5 | /functions
6 | .env
7 |
8 |
--------------------------------------------------------------------------------
/static/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/app.js:
--------------------------------------------------------------------------------
1 | export { j as init, r as render } from "./chunks/app-14a936dc.js";
2 |
--------------------------------------------------------------------------------
/static/default.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tastejs/sveltekit-movie-app/HEAD/static/default.jpg
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tastejs/sveltekit-movie-app/HEAD/static/favicon.ico
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/chunks/singletons-12a22614.js:
--------------------------------------------------------------------------------
1 | let i;function r(t){i=t}export{r as i,i as r};
2 |
--------------------------------------------------------------------------------
/static/icons8-moon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tastejs/sveltekit-movie-app/HEAD/static/icons8-moon-60.png
--------------------------------------------------------------------------------
/static/icons8-sun-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tastejs/sveltekit-movie-app/HEAD/static/icons8-sun-24.png
--------------------------------------------------------------------------------
/static/icons8-sun-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tastejs/sveltekit-movie-app/HEAD/static/icons8-sun-48.png
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "useTabs": true,
3 | "singleQuote": true,
4 | "trailingComma": "none",
5 | "printWidth": 100
6 | }
7 |
--------------------------------------------------------------------------------
/static/sun_light_mode_day-512.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tastejs/sveltekit-movie-app/HEAD/static/sun_light_mode_day-512.webp
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | command = "npm run build"
3 | publish = "build/"
4 |
5 | [dev]
6 | command = "svelte-kit dev"
7 | framework = "svelte-kit"
--------------------------------------------------------------------------------
/.svelte-kit/dev/runtime/env.js:
--------------------------------------------------------------------------------
1 | let prerendering = false;
2 |
3 | /** @param {boolean} value */
4 | function set_prerendering(value) {
5 | prerendering = value;
6 | }
7 |
8 | export { prerendering, set_prerendering };
9 |
--------------------------------------------------------------------------------
/.svelte-kit/build/runtime/env.js:
--------------------------------------------------------------------------------
1 | let prerendering = false;
2 |
3 | /** @param {boolean} value */
4 | function set_prerendering(value) {
5 | prerendering = value;
6 | }
7 |
8 | export { prerendering, set_prerendering };
9 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/assets/start-464e9d0a.css:
--------------------------------------------------------------------------------
1 | #svelte-announcer.svelte-1pdgbjn{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap;width:1px}
2 |
--------------------------------------------------------------------------------
/.svelte-kit/build/runtime/internal/singletons.js:
--------------------------------------------------------------------------------
1 | /** @type {import('./router').Router?} */
2 | let router;
3 |
4 | /** @param {import('./router').Router?} _ */
5 | function init(_) {
6 | router = _;
7 | }
8 |
9 | export { init, router };
10 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/chunks/store-07881416.js:
--------------------------------------------------------------------------------
1 | import{C as s}from"./vendor-fc6286ba.js";const e=s(1),o=s("movie"),t=s(null),n=s(""),c=s(0),r=s(0),m=s([]),_=s([]),d=s([]);export{o as a,n as b,e as c,m as d,r as e,c as f,d as m,t as s,_ as t};
2 |
--------------------------------------------------------------------------------
/src/lib/utilities/PageTransition.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 | This route doesn't exist.
`;
5 | });
6 | export { NotFound as default };
7 |
--------------------------------------------------------------------------------
/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | element in src/app.html
21 | target: '#svelte'
22 | }
23 | };
24 |
25 | export default config;
26 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/stores-bd543f9c.js:
--------------------------------------------------------------------------------
1 | import { i as getContext } from "./app-14a936dc.js";
2 | const getStores = () => {
3 | const stores = getContext("__svelte__");
4 | return {
5 | page: {
6 | subscribe: stores.page.subscribe
7 | },
8 | navigating: {
9 | subscribe: stores.navigating.subscribe
10 | },
11 | get preloading() {
12 | console.error("stores.preloading is deprecated; use stores.navigating instead");
13 | return {
14 | subscribe: stores.navigating.subscribe
15 | };
16 | },
17 | session: stores.session
18 | };
19 | };
20 | const page = {
21 | subscribe(fn) {
22 | const store = getStores().page;
23 | return store.subscribe(fn);
24 | }
25 | };
26 | export { page as p };
27 |
--------------------------------------------------------------------------------
/.svelte-kit/dev/components/error.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
{status}
19 |
20 |
{error.message}
21 |
22 |
23 |
24 | {#if error.frame}
25 |
{error.frame}
26 | {/if}
27 | {#if error.stack}
28 |
{error.stack}
29 | {/if}
30 |
--------------------------------------------------------------------------------
/.svelte-kit/build/components/error.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
{status}
19 |
20 |
{error.message}
21 |
22 |
23 |
24 | {#if error.frame}
25 |
{error.frame}
26 | {/if}
27 | {#if error.stack}
28 |
{error.stack}
29 | {/if}
30 |
--------------------------------------------------------------------------------
/src/lib/utilities/Search.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
29 |
--------------------------------------------------------------------------------
/src/lib/components/PersonCard.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
22 |
--------------------------------------------------------------------------------
/src/lib/utilities/MorePages.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 | {#if total_pages > 1}
15 |
16 | handleMorePages()}
20 | >
21 | MORE
22 |
23 |
24 | {/if}
25 |
--------------------------------------------------------------------------------
/src/lib/components/SeasonTitle.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
{$show_name}
12 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/lib/stores/store.ts:
--------------------------------------------------------------------------------
1 | import type { Writable } from 'svelte/store';
2 | import { writable } from 'svelte/store';
3 |
4 | export const current_page: Writable
= writable(1);
5 | export const trailer_key: Writable = writable('xyz');
6 | export const video_site: Writable = writable('');
7 |
8 |
9 | export const media_type: Writable = writable('movie');
10 |
11 | export const tv_network: Writable = writable([]);
12 | export const selected: Writable = writable(null);
13 | export const theme_dark: Writable = writable(false);
14 | export const show_name: Writable = writable('');
15 | export const season_count: Writable = writable(0);
16 | export const show_id: Writable = writable(0);
17 | export const data = writable([])
18 |
19 | export const tv_genres: Writable = writable([]);
20 | export const movie_genres: Writable = writable([]);
--------------------------------------------------------------------------------
/src/routes/episode/[id]/[season_number]/[episode_number].svelte:
--------------------------------------------------------------------------------
1 |
28 |
29 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/routes/seasons/[id]/[season_number].svelte:
--------------------------------------------------------------------------------
1 |
27 |
28 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/static/icons8-sun.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/lib/utilities/Spinner.svelte:
--------------------------------------------------------------------------------
1 |
10 |
11 |
33 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/ProgressBar-607c37c9.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, a as add_attribute, b as escape } from "./app-14a936dc.js";
2 | const ProgressBar = create_ssr_component(($$result, $$props, $$bindings, slots) => {
3 | let { progress } = $$props;
4 | let progress_percent;
5 | let canvas;
6 | if ($$props.progress === void 0 && $$bindings.progress && progress !== void 0)
7 | $$bindings.progress(progress);
8 | progress_percent = progress * 10;
9 | return `
10 |
${escape(progress_percent)}% `;
11 | });
12 | export { ProgressBar as P };
13 |
--------------------------------------------------------------------------------
/src/routes/index.svelte:
--------------------------------------------------------------------------------
1 |
31 |
32 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "moduleResolution": "node",
4 | "module": "es2020",
5 | "lib": ["es2020", "DOM"],
6 | "target": "es2019",
7 | /**
8 | svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
9 | to enforce using \`import type\` instead of \`import\` for Types.
10 | */
11 | "importsNotUsedAsValues": "error",
12 | "isolatedModules": true,
13 | "resolveJsonModule": true,
14 | /**
15 | To have warnings/errors of the Svelte compiler at the correct position,
16 | enable source maps by default.
17 | */
18 | "sourceMap": true,
19 | "esModuleInterop": true,
20 | "skipLibCheck": true,
21 | "forceConsistentCasingInFileNames": true,
22 | "baseUrl": ".",
23 | "allowJs": true,
24 | "checkJs": true,
25 | "paths": {
26 | "$lib": ["src/lib"],
27 | "$lib/*": ["src/lib/*"],
28 | "$stores":["src/lib/stores"],
29 | "$api":["src/routes/api"],
30 | "$api/*":["src/routes/api/*"]
31 | }
32 | },
33 | "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
34 | }
35 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/search/[id].svelte-63c2cd3f.js:
--------------------------------------------------------------------------------
1 | import{N as i,S as c,i as p,s as m,j as u,m as l,o as f,x as _,u as g,v as d}from"../../chunks/vendor-fc6286ba.js";import{d as r,a as h}from"../../chunks/store-07881416.js";import{M as $}from"../../chunks/MainSection-8e495d87.js";import"../../chunks/ProgressBar-f61e37f1.js";function j(n){let a,s;return a=new $({props:{total_pages:n[0]}}),{c(){u(a.$$.fragment)},l(t){l(a.$$.fragment,t)},m(t,e){f(a,t,e),s=!0},p(t,[e]){const o={};e&1&&(o.total_pages=t[0]),a.$set(o)},i(t){s||(_(a.$$.fragment,t),s=!0)},o(t){g(a.$$.fragment,t),s=!1},d(t){d(a,t)}}}async function x({fetch:n,page:a}){const t=await(await n("../api/getSearch",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({media:i(h),page:"1",query:a.params.id})})).json();r.set(await t.res.results);const e=await t.res.total_pages;return{props:{data:r,total_pages:e}}}function y(n,a,s){let{total_pages:t}=a;return n.$$set=e=>{"total_pages"in e&&s(0,t=e.total_pages)},[t]}class M extends c{constructor(a){super();p(this,a,y,j,m,{total_pages:0})}}export{M as default,x as load};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/index.svelte-0b7a5c7b.js:
--------------------------------------------------------------------------------
1 | import{S as c,i as p,s as m,j as u,m as l,o as _,x as f,u as g,v as d,L as h,M as j}from"../chunks/vendor-fc6286ba.js";import{d as r,s as i}from"../chunks/store-07881416.js";import{M as S}from"../chunks/MainSection-8e495d87.js";import"../chunks/ProgressBar-f61e37f1.js";function w(a){let e,s;return e=new S({props:{total_pages:a[0]}}),{c(){u(e.$$.fragment)},l(t){l(e.$$.fragment,t)},m(t,o){_(e,t,o),s=!0},p(t,[o]){const n={};o&1&&(n.total_pages=t[0]),e.$set(n)},i(t){s||(f(e.$$.fragment,t),s=!0)},o(t){g(e.$$.fragment,t),s=!1},d(t){d(e,t)}}}async function M({fetch:a}){r.set(void 0);const s=await(await a("./api/getShow",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({media:"movie",page:"1"})})).json();return r.set(await s.res.results),{props:{total_pages:await s.res.total_pages}}}function $(a,e,s){let t;h(a,i,n=>s(1,t=n));let{total_pages:o}=e;return j(i,t=null,t),a.$$set=n=>{"total_pages"in n&&s(0,o=n.total_pages)},[o]}class x extends c{constructor(e){super();p(this,e,$,w,m,{total_pages:0})}}export{x as default,M as load};
2 |
--------------------------------------------------------------------------------
/src/routes/trending/[media].svelte:
--------------------------------------------------------------------------------
1 |
32 |
33 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/lib/components/PageTitle.svelte:
--------------------------------------------------------------------------------
1 |
29 |
30 |
31 |
{page_title}
32 |
33 |
--------------------------------------------------------------------------------
/src/routes/search/[id].svelte:
--------------------------------------------------------------------------------
1 |
32 |
33 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/lib/utilities/InfiniteScroll.svelte:
--------------------------------------------------------------------------------
1 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/trending/[media].svelte-40e542c5.js:
--------------------------------------------------------------------------------
1 | import{S as c,i as m,s as p,j as u,m as l,o as _,x as d,u as f,v as g,L as h,M as j}from"../../chunks/vendor-fc6286ba.js";import{d as r,a as S,s as i}from"../../chunks/store-07881416.js";import{M as w}from"../../chunks/MainSection-8e495d87.js";import"../../chunks/ProgressBar-f61e37f1.js";function y(s){let e,a;return e=new w({props:{total_pages:s[0]}}),{c(){u(e.$$.fragment)},l(t){l(e.$$.fragment,t)},m(t,n){_(e,t,n),a=!0},p(t,[n]){const o={};n&1&&(o.total_pages=t[0]),e.$set(o)},i(t){a||(d(e.$$.fragment,t),a=!0)},o(t){f(e.$$.fragment,t),a=!1},d(t){g(e,t)}}}async function x({fetch:s,page:e}){r.set(void 0),S.set(e.params.media);const t=await(await s("../../api/getShow",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({media:e.params.media,page:"1"})})).json();return r.set(await t.res.results),{props:{total_pages:await t.res.total_pages}}}function $(s,e,a){let t;h(s,i,o=>a(1,t=o));let{total_pages:n}=e;return j(i,t=null,t),s.$$set=o=>{"total_pages"in o&&a(0,n=o.total_pages)},[n]}class B extends c{constructor(e){super();m(this,e,$,y,p,{total_pages:0})}}export{B as default,x as load};
2 |
--------------------------------------------------------------------------------
/src/routes/__error.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
20 |
21 |
22 | {title}
23 |
24 |
25 | {title}
26 |
27 | {message}
28 |
29 | {#if error.stack}
30 |
31 | This page does not exist
32 |
33 | {error.stack}
34 | {/if}
35 |
36 |
55 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[id]-6969a75f.js:
--------------------------------------------------------------------------------
1 | import { g as get_store_value, c as create_ssr_component, v as validate_component } from "./app-14a936dc.js";
2 | import { d as data, a as media_type } from "./store-cc224516.js";
3 | import { M as MainSection } from "./MainSection-8f5559a2.js";
4 | import "./ProgressBar-607c37c9.js";
5 | async function load({ fetch, page }) {
6 | const res = await fetch("../api/getSearch", {
7 | headers: { "Content-Type": "application/json" },
8 | method: "POST",
9 | body: JSON.stringify({
10 | media: get_store_value(media_type),
11 | page: "1",
12 | query: page.params.id
13 | })
14 | });
15 | const datas = await res.json();
16 | data.set(await datas.res.results);
17 | const total_pages = await datas.res.total_pages;
18 | return { props: { data, total_pages } };
19 | }
20 | const U5Bidu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
21 | let { total_pages } = $$props;
22 | if ($$props.total_pages === void 0 && $$bindings.total_pages && total_pages !== void 0)
23 | $$bindings.total_pages(total_pages);
24 | return `${validate_component(MainSection, "MainSection").$$render($$result, { total_pages }, {}, {})}`;
25 | });
26 | export { U5Bidu5D as default, load };
27 |
--------------------------------------------------------------------------------
/src/routes/genre/[media]/[id].svelte:
--------------------------------------------------------------------------------
1 |
36 |
37 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/src/routes/person/[id].svelte:
--------------------------------------------------------------------------------
1 |
46 |
47 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/genre/[media]/[id].svelte-5293c531.js:
--------------------------------------------------------------------------------
1 | import{S as m,i as u,s as l,j as p,m as g,o as f,x as _,u as d,v as h,L as j,M as S}from"../../../chunks/vendor-fc6286ba.js";import{d as i,a as w,s as c}from"../../../chunks/store-07881416.js";import{M as y}from"../../../chunks/MainSection-8e495d87.js";import"../../../chunks/ProgressBar-f61e37f1.js";function b(n){let e,s;return e=new y({props:{total_pages:n[0],genres:n[1]}}),{c(){p(e.$$.fragment)},l(t){g(e.$$.fragment,t)},m(t,a){f(e,t,a),s=!0},p(t,[a]){const o={};a&1&&(o.total_pages=t[0]),a&2&&(o.genres=t[1]),e.$set(o)},i(t){s||(_(e.$$.fragment,t),s=!0)},o(t){d(e.$$.fragment,t),s=!1},d(t){h(e,t)}}}const O=!0;async function P({fetch:n,page:e}){i.set(void 0);const s=e.params.id;w.set(e.params.media);const a=await(await n("../../api/getShowGenre",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({media:e.params.media,page:"1",genre:s})})).json();return i.set(await a.res.results),{props:{total_pages:await a.res.total_pages,genres:s}}}function k(n,e,s){let t;j(n,c,r=>s(2,t=r));let{total_pages:a}=e,{genres:o}=e;return S(c,t=null,t),n.$$set=r=>{"total_pages"in r&&s(0,a=r.total_pages),"genres"in r&&s(1,o=r.genres)},[a,o]}class T extends m{constructor(e){super();u(this,e,k,b,l,{total_pages:0,genres:1})}}export{T as default,P as load,O as prerender};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/index-6445fb8c.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, s as subscribe, f as set_store_value, v as validate_component } from "./app-14a936dc.js";
2 | import { d as data, s as selected } from "./store-cc224516.js";
3 | import { M as MainSection } from "./MainSection-8f5559a2.js";
4 | import "./ProgressBar-607c37c9.js";
5 | async function load({ fetch }) {
6 | data.set(void 0);
7 | const res = await fetch("./api/getShow", {
8 | headers: { "Content-Type": "application/json" },
9 | method: "POST",
10 | body: JSON.stringify({ media: "movie", page: "1" })
11 | });
12 | const datas = await res.json();
13 | data.set(await datas.res.results);
14 | const total_pages = await datas.res.total_pages;
15 | return { props: { total_pages } };
16 | }
17 | const Routes = create_ssr_component(($$result, $$props, $$bindings, slots) => {
18 | let $selected, $$unsubscribe_selected;
19 | $$unsubscribe_selected = subscribe(selected, (value) => $selected = value);
20 | let { total_pages } = $$props;
21 | set_store_value(selected, $selected = null, $selected);
22 | if ($$props.total_pages === void 0 && $$bindings.total_pages && total_pages !== void 0)
23 | $$bindings.total_pages(total_pages);
24 | $$unsubscribe_selected();
25 | return `${validate_component(MainSection, "MainSection").$$render($$result, { total_pages }, {}, {})}`;
26 | });
27 | export { Routes as default, load };
28 |
--------------------------------------------------------------------------------
/src/lib/utilities/tooltip.ts:
--------------------------------------------------------------------------------
1 | export function tooltip(element) {
2 | let div;
3 | let title;
4 | function mouseOver(event) {
5 | // NOTE: remove the `title` attribute, to prevent showing the default browser tooltip
6 | // remember to set it back on `mouseleave`
7 | title = element.getAttribute('title');
8 | element.removeAttribute('title');
9 |
10 | div = document.createElement('div');
11 | div.textContent = title;
12 | div.style = `
13 | border: 1px solid #ddd;
14 | box-shadow: 1px 1px 1px #ddd;
15 | background: white;
16 | border-radius: 4px;
17 | padding: 4px;
18 | position: absolute;
19 | top: ${event.pageX + 5}px;
20 | left: ${event.pageY + 5}px;
21 | `;
22 | document.body.appendChild(div);
23 | }
24 | function mouseMove(event) {
25 | div.style.left = `${event.pageX + 5}px`;
26 | div.style.top = `${event.pageY + 5}px`;
27 | }
28 | function mouseLeave() {
29 | document.body.removeChild(div);
30 | // NOTE: restore the `title` attribute
31 | element.setAttribute('title', title);
32 | }
33 |
34 | element.addEventListener('mouseover', mouseOver);
35 | element.addEventListener('mouseleave', mouseLeave);
36 | element.addEventListener('mousemove', mouseMove);
37 |
38 | return {
39 | destroy() {
40 | element.removeEventListener('mouseover', mouseOver);
41 | element.removeEventListener('mouseleave', mouseLeave);
42 | element.removeEventListener('mousemove', mouseMove);
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[media]-0dee69ba.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, s as subscribe, f as set_store_value, v as validate_component } from "./app-14a936dc.js";
2 | import { d as data, a as media_type, s as selected } from "./store-cc224516.js";
3 | import { M as MainSection } from "./MainSection-8f5559a2.js";
4 | import "./ProgressBar-607c37c9.js";
5 | async function load({ fetch, page }) {
6 | data.set(void 0);
7 | media_type.set(page.params.media);
8 | const res = await fetch("../../api/getShow", {
9 | headers: { "Content-Type": "application/json" },
10 | method: "POST",
11 | body: JSON.stringify({ media: page.params.media, page: "1" })
12 | });
13 | const datas = await res.json();
14 | data.set(await datas.res.results);
15 | const total_pages = await datas.res.total_pages;
16 | return { props: { total_pages } };
17 | }
18 | const U5Bmediau5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
19 | let $selected, $$unsubscribe_selected;
20 | $$unsubscribe_selected = subscribe(selected, (value) => $selected = value);
21 | let { total_pages } = $$props;
22 | set_store_value(selected, $selected = null, $selected);
23 | if ($$props.total_pages === void 0 && $$bindings.total_pages && total_pages !== void 0)
24 | $$bindings.total_pages(total_pages);
25 | $$unsubscribe_selected();
26 | return `${validate_component(MainSection, "MainSection").$$render($$result, { total_pages }, {}, {})}`;
27 | });
28 | export { U5Bmediau5D as default, load };
29 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/__error-7ac6427a.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, b as escape } from "./app-14a936dc.js";
2 | var __error_svelte_svelte_type_style_lang = "";
3 | const css = {
4 | code: "h1.svelte-be3lyz,p.svelte-be3lyz{margin:0 auto}h1.svelte-be3lyz{font-size:2.8em;font-weight:700;margin:0 0 .5em}p.svelte-be3lyz{margin:1em auto}@media(min-width:480px){h1.svelte-be3lyz{font-size:4em}}",
5 | map: null
6 | };
7 | function load({ error, status }) {
8 | return { props: { error, status } };
9 | }
10 | const _error = create_ssr_component(($$result, $$props, $$bindings, slots) => {
11 | let { status } = $$props;
12 | let { error } = $$props;
13 | const offline = typeof navigator !== "undefined" && navigator.onLine === false;
14 | const title = offline ? "Offline" : status;
15 | const message = offline ? "Find the internet and try again" : error.message;
16 | if ($$props.status === void 0 && $$bindings.status && status !== void 0)
17 | $$bindings.status(status);
18 | if ($$props.error === void 0 && $$bindings.error && error !== void 0)
19 | $$bindings.error(error);
20 | $$result.css.add(css);
21 | return `${$$result.head += `${$$result.title = `${escape(title)} `, ""}`, ""}
22 |
23 | ${escape(title)}
24 |
25 | ${escape(message)}
26 |
27 | ${error.stack ? `
28 | This page does not exist
29 |
30 | ${escape(error.stack)} ` : ``}`;
31 | });
32 | export { _error as default, load };
33 |
--------------------------------------------------------------------------------
/src/lib/components/MovieCard.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/src/lib/utilities/Modal.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 | {#if shown}
14 |
15 |
16 | {#if $video_site === 'YouTube'}
17 | VIDEO
26 |
27 | {:else if $video_site === 'Vimeo'}
28 |
36 | {/if}
37 |
38 |
39 | hide()}
42 | >
43 |
44 |
45 |
46 | {/if}
47 |
--------------------------------------------------------------------------------
/src/lib/components/TvCard.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
41 |
--------------------------------------------------------------------------------
/.svelte-kit/build/generated/root.svelte:
--------------------------------------------------------------------------------
1 |
2 |
35 |
36 |
37 | {#if components[1]}
38 |
39 | {#if components[2]}
40 |
41 | {/if}
42 |
43 | {/if}
44 |
45 |
46 | {#if mounted}
47 |
48 | {#if navigated}
49 | {title}
50 | {/if}
51 |
52 | {/if}
53 |
54 |
--------------------------------------------------------------------------------
/src/app.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | @layer base {
6 | .light {
7 | --color-text-base: #eae2e2;
8 | --color-text-muted: #ffcf91;
9 | --color-text-inverted: #ffffff;
10 | --color-text-muted-inverted: #d7d7d7;
11 | --color-text-selected: #f19f36;
12 | --color-bg: #938e94;
13 | --color-primary: #5d5c61;
14 | --color-secondary: #7395ae;
15 | --color-tertiary: #557a95;
16 | --color-border: #b0a295;
17 | }
18 |
19 | .dark {
20 | --color-text-base: #09d3ac;
21 | --color-text-muted: #ffffff;
22 | --color-text-inverted: #ececec;
23 | --color-text-muted-inverted: #616161;
24 | --color-text-selected: #ff206e;
25 | --color-bg: #000000;
26 | --color-primary: #424242;
27 | --color-secondary: #393737;
28 | --color-tertiary: #1c1c1c;
29 | --color-border: #303030;
30 | }
31 |
32 | @font-face {
33 | font-family: 'Raleway';
34 | font-weight: 400;
35 | font-style: normal;
36 | unicode-range: U+000-5FF;
37 | src: local('Raleway');
38 | font-display: swap;
39 | }
40 |
41 | h1 {
42 | @apply text-4xl;
43 | }
44 | h2 {
45 | @apply text-3xl;
46 | }
47 | h3 {
48 | @apply text-2xl;
49 | }
50 | h4 {
51 | @apply text-xl;
52 | }
53 | h5 {
54 | @apply text-lg;
55 | }
56 | h6 {
57 | @apply text-base;
58 | }
59 | p {
60 | @apply text-xs;
61 | }
62 | h1,
63 | h2,
64 | h3,
65 | h4,
66 | h5,
67 | h6 {
68 | @apply font-semibold;
69 | }
70 | body {
71 | @apply mx-auto;
72 | @apply bg-skin-bg;
73 | }
74 | }
75 |
76 | html {
77 | overflow-y: scroll;
78 | }
79 |
80 | .root {
81 | display: flex;
82 | flex-direction: column;
83 | }
84 |
--------------------------------------------------------------------------------
/src/lib/stores/theme-store.ts:
--------------------------------------------------------------------------------
1 | import { get, writable } from 'svelte/store';
2 | import type { Readable } from 'svelte/store';
3 |
4 | import { browser } from '$app/env';
5 |
6 | function _theme() {
7 | const { set, subscribe } = writable('');
8 |
9 | return {
10 | subscribe,
11 | update: (theme: Readable) => get(theme),
12 | get: (theme: Readable) => get(theme),
13 | set: (theme: string) => {
14 | if (!browser) return; // ignore during SSR
15 | const currentTheme = document.querySelector('html').classList.contains('dark')
16 | ? 'dark'
17 | : 'light';
18 | set(theme);
19 | document.querySelector('html').classList.replace(currentTheme, theme);
20 |
21 | localStorage.setItem('theme', theme);
22 | },
23 | init: () => {
24 | if (!browser) return; // ignore during SSR
25 | if (
26 | !localStorage.getItem('theme') &&
27 | window.matchMedia('(prefers-color-scheme: dark)').matches
28 | ) {
29 | set('dark');
30 |
31 | document.querySelector('html').classList.add('dark');
32 |
33 | localStorage.setItem('theme', 'dark');
34 | } else {
35 | const theme = localStorage.getItem('theme') || 'light';
36 | document.querySelector('html').classList.add(theme);
37 |
38 | set(localStorage.getItem('theme'));
39 | }
40 | },
41 | reset: () => {
42 | set(undefined);
43 | browser ? localStorage.removeItem('theme') : null;
44 | }
45 | };
46 | }
47 |
48 | export const theme = _theme();
49 |
50 | // the docs on svelte stores can be found here if this is a bit confusing
51 | // essentially you can use these to share state between many components
52 | // https://svelte.dev/docs#svelte_store
53 |
--------------------------------------------------------------------------------
/.svelte-kit/dev/generated/root.svelte:
--------------------------------------------------------------------------------
1 |
2 |
35 |
36 | {#if components[1]}
37 |
38 | {#if components[2]}
39 |
40 |
41 |
42 | {:else}
43 |
44 | {/if}
45 |
46 | {:else}
47 |
48 | {/if}
49 |
50 | {#if mounted}
51 |
52 | {#if navigated}
53 | {title}
54 | {/if}
55 |
56 | {/if}
--------------------------------------------------------------------------------
/src/lib/pages/Season.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
15 | {#if season_details.id}
16 |
Season Information
17 | {#each season_details.episodes as episode}
18 |
40 | {/each}
41 | {/if}
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/routes/__layout.svelte:
--------------------------------------------------------------------------------
1 |
18 |
19 |
25 |
26 |
27 |
28 |
32 |
36 | TMDB on Sveltekit
37 |
38 |
39 |
40 |
41 |
42 |
43 |
46 |
47 |
48 |
51 |
52 |
--------------------------------------------------------------------------------
/src/lib/components/Cast.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 | {#if cast.length}
7 |
11 |
14 | Top Billed Cast
15 |
16 |
19 | {#each cast as person}
20 |
51 | {/each}
52 |
53 |
54 | {/if}
55 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sveltekit-movie-app",
3 | "version": "0.0.1",
4 | "scripts": {
5 | "dev": "svelte-kit dev",
6 | "build": "svelte-kit build",
7 | "package": "svelte-kit package",
8 | "preview": "svelte-kit preview",
9 | "check": "svelte-check --tsconfig ./tsconfig.json",
10 | "rimraf": "./node_modules/rimraf/bin.js",
11 | "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
12 | "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
13 | "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
14 | },
15 | "devDependencies": {
16 | "@sveltejs/adapter-netlify": "^1.0.0-next.38",
17 | "@sveltejs/adapter-node": "^1.0.0-next.61",
18 | "@sveltejs/adapter-static": "^1.0.0-next.26",
19 | "@sveltejs/kit": "^1.0.0-next.229",
20 | "@tailwindcss/line-clamp": "^0.3.0",
21 | "@types/node": "^17.0.8",
22 | "@typescript-eslint/eslint-plugin": "^5.8.0",
23 | "@typescript-eslint/parser": "^5.8.0",
24 | "autoprefixer": "^10.4.0",
25 | "cssnano": "^5.0.14",
26 | "eslint": "^8.5.0",
27 | "eslint-config-prettier": "^8.3.0",
28 | "eslint-plugin-svelte3": "^3.2.1",
29 | "node-fetch": "^3.1.0",
30 | "postcss": "^8.4.5",
31 | "postcss-load-config": "^3.1.0",
32 | "prettier": "~2.5.1",
33 | "prettier-plugin-svelte": "^2.5.1",
34 | "stream": "^0.0.2",
35 | "svelte": "^3.42.6",
36 | "svelte-preprocess": "^4.9.4",
37 | "tailwindcss": "^3.0.7",
38 | "tslib": "^2.3.1",
39 | "typescript": "^4.5.4",
40 | "vite": "^2.7.7"
41 | },
42 | "type": "module",
43 | "engines": {
44 | "node": ">= 12.17.0"
45 | },
46 | "dependencies": {
47 | "sapper-environment": "^1.0.1"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/__error.svelte-1cf9c0b1.js:
--------------------------------------------------------------------------------
1 | import{S as C,i as D,s as F,e as p,t as v,k as h,c as k,a as y,g as b,d as o,n as E,f as d,D as z,h as L,l as P,Q as N,b as S,H as T}from"../chunks/vendor-fc6286ba.js";function j(f){let s,u,a,r,_=f[0].stack+"",n;return{c(){s=p("h2"),u=v("This page does not exist"),a=h(),r=p("pre"),n=v(_)},l(t){s=k(t,"H2",{});var l=y(s);u=b(l,"This page does not exist"),l.forEach(o),a=E(t),r=k(t,"PRE",{});var m=y(r);n=b(m,_),m.forEach(o)},m(t,l){d(t,s,l),z(s,u),d(t,a,l),d(t,r,l),z(r,n)},p(t,l){l&1&&_!==(_=t[0].stack+"")&&L(n,_)},d(t){t&&o(s),t&&o(a),t&&o(r)}}}function O(f){let s,u,a,r,_,n,t,l,m;document.title=s=f[1];let i=f[0].stack&&j(f);return{c(){u=h(),a=p("h1"),r=v(f[1]),_=h(),n=p("p"),t=v(f[2]),l=h(),i&&i.c(),m=P(),this.h()},l(e){N('[data-svelte="svelte-1az6e94"]',document.head).forEach(o),u=E(e),a=k(e,"H1",{class:!0});var H=y(a);r=b(H,f[1]),H.forEach(o),_=E(e),n=k(e,"P",{class:!0});var q=y(n);t=b(q,f[2]),q.forEach(o),l=E(e),i&&i.l(e),m=P(),this.h()},h(){S(a,"class","svelte-be3lyz"),S(n,"class","svelte-be3lyz")},m(e,c){d(e,u,c),d(e,a,c),z(a,r),d(e,_,c),d(e,n,c),z(n,t),d(e,l,c),i&&i.m(e,c),d(e,m,c)},p(e,[c]){c&2&&s!==(s=e[1])&&(document.title=s),e[0].stack?i?i.p(e,c):(i=j(e),i.c(),i.m(m.parentNode,m)):i&&(i.d(1),i=null)},i:T,o:T,d(e){e&&o(u),e&&o(a),e&&o(_),e&&o(n),e&&o(l),i&&i.d(e),e&&o(m)}}}function w({error:f,status:s}){return{props:{error:f,status:s}}}function Q(f,s,u){let{status:a}=s,{error:r}=s;const _=typeof navigator!="undefined"&&navigator.onLine===!1,n=_?"Offline":a,t=_?"Find the internet and try again":r.message;return f.$$set=l=>{"status"in l&&u(3,a=l.status),"error"in l&&u(0,r=l.error)},[r,n,t,a]}class A extends C{constructor(s){super();D(this,s,Q,O,F,{status:3,error:0})}}export{A as default,w as load};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/build/runtime/app/navigation.js:
--------------------------------------------------------------------------------
1 | import { router as router$1 } from '../internal/singletons.js';
2 | import { g as get_base_uri } from '../chunks/utils.js';
3 |
4 | const router = /** @type {import('../client/router').Router} */ (router$1);
5 |
6 | /**
7 | * @param {string} name
8 | */
9 | function guard(name) {
10 | return () => {
11 | throw new Error(`Cannot call ${name}(...) on the server`);
12 | };
13 | }
14 |
15 | const goto = import.meta.env.SSR ? guard('goto') : goto_;
16 | const invalidate = import.meta.env.SSR ? guard('invalidate') : invalidate_;
17 | const prefetch = import.meta.env.SSR ? guard('prefetch') : prefetch_;
18 | const prefetchRoutes = import.meta.env.SSR ? guard('prefetchRoutes') : prefetchRoutes_;
19 |
20 | /**
21 | * @type {import('$app/navigation').goto}
22 | */
23 | async function goto_(href, opts) {
24 | return router.goto(href, opts, []);
25 | }
26 |
27 | /**
28 | * @type {import('$app/navigation').invalidate}
29 | */
30 | async function invalidate_(resource) {
31 | const { href } = new URL(resource, location.href);
32 | return router.renderer.invalidate(href);
33 | }
34 |
35 | /**
36 | * @type {import('$app/navigation').prefetch}
37 | */
38 | function prefetch_(href) {
39 | return router.prefetch(new URL(href, get_base_uri(document)));
40 | }
41 |
42 | /**
43 | * @type {import('$app/navigation').prefetchRoutes}
44 | */
45 | async function prefetchRoutes_(pathnames) {
46 | const matching = pathnames
47 | ? router.routes.filter((route) => pathnames.some((pathname) => route[0].test(pathname)))
48 | : router.routes;
49 |
50 | const promises = matching.map((r) => Promise.all(r[1].map((load) => load())));
51 |
52 | await Promise.all(promises);
53 | }
54 |
55 | export { goto, invalidate, prefetch, prefetchRoutes };
56 |
--------------------------------------------------------------------------------
/src/routes/movie/[id].svelte:
--------------------------------------------------------------------------------
1 |
61 |
62 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[id]-d1cca444.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, s as subscribe, f as set_store_value, v as validate_component } from "./app-14a936dc.js";
2 | import { d as data, a as media_type, s as selected } from "./store-cc224516.js";
3 | import { M as MainSection } from "./MainSection-8f5559a2.js";
4 | import "./ProgressBar-607c37c9.js";
5 | const prerender = true;
6 | async function load({ fetch, page }) {
7 | data.set(void 0);
8 | const genres = page.params.id;
9 | media_type.set(page.params.media);
10 | const res = await fetch("../../api/getShowGenre", {
11 | headers: { "Content-Type": "application/json" },
12 | method: "POST",
13 | body: JSON.stringify({
14 | media: page.params.media,
15 | page: "1",
16 | genre: genres
17 | })
18 | });
19 | const datas = await res.json();
20 | data.set(await datas.res.results);
21 | const total_pages = await datas.res.total_pages;
22 | return { props: { total_pages, genres } };
23 | }
24 | const U5Bidu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
25 | let $selected, $$unsubscribe_selected;
26 | $$unsubscribe_selected = subscribe(selected, (value) => $selected = value);
27 | let { total_pages } = $$props;
28 | let { genres } = $$props;
29 | set_store_value(selected, $selected = null, $selected);
30 | if ($$props.total_pages === void 0 && $$bindings.total_pages && total_pages !== void 0)
31 | $$bindings.total_pages(total_pages);
32 | if ($$props.genres === void 0 && $$bindings.genres && genres !== void 0)
33 | $$bindings.genres(genres);
34 | $$unsubscribe_selected();
35 | return `${validate_component(MainSection, "MainSection").$$render($$result, { total_pages, genres }, {}, {})}`;
36 | });
37 | export { U5Bidu5D as default, load, prerender };
38 |
--------------------------------------------------------------------------------
/src/routes/api/postData.ts:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
2 | const base = "https://api.themoviedb.org/3/"
3 | const urls = {
4 | cast: '${request.body["media"]}/${request.body["id"]}/credits?api_key=${api}&language=en-US',
5 | episode: 'tv/${request.body["id"]}/season/${request.body["season_number"]}/episode/${request.body["episode_number"]}?api_key=${api}&language=en-US',
6 | known_for: 'person/${request.body["person"]}/combined_credits?api_key=${api}&language=en-US',
7 | show_detail: '${request.body["media"]}/${request.body["id"]}?api_key=${api}&language=en-US',
8 | person: '${request.body["media"]}/${request.body["id"]}?api_key=${api}&language=en-US',
9 | search: 'search/${request.body["media"]}?api_key=${api}&language=en-US&page=${request.body["page"]}&include_adult=false&query=${request.body["query"]}',
10 | season: 'tv/${request.body["id"]}/season/${request.body["season_number"]}?api_key=${api}&language=en-US',
11 | show: 'trending/${request.body["media"]}/week?api_key=${api}&language=en-GB&page=${request.body["page"]}',
12 | show_genres: 'discover/${request.body["media"]}?api_key=${api}&with_genres=${request.body["genre"]}&page=${request.body["page"]}',
13 | trailer: '${request.body["media"]}/${request.body["id"]}/videos?api_key=${api}&language=en-US'
14 | }
15 |
16 | export async function post(request: { body: { [x: string]: string } }): Promise<{ body: string; }> {
17 | try {
18 | let api = import.meta.env.VITE_API_KEY;
19 | const fetch_url = base + [eval('`' + urls[request.body["api_ref"]] + '`')]
20 | const res = await (await fetch(fetch_url)).json()
21 | return {
22 | body: JSON.stringify({ res })
23 | }
24 | }
25 | catch (e) {
26 | console.log('error', e)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/routes/tv/[id].svelte:
--------------------------------------------------------------------------------
1 |
60 |
61 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/src/lib/utilities/ProgressBar.svelte:
--------------------------------------------------------------------------------
1 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | {progress_percent}%
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/store-cc224516.js:
--------------------------------------------------------------------------------
1 | import { n as noop, d as safe_not_equal } from "./app-14a936dc.js";
2 | const subscriber_queue = [];
3 | function writable(value, start = noop) {
4 | let stop;
5 | const subscribers = new Set();
6 | function set(new_value) {
7 | if (safe_not_equal(value, new_value)) {
8 | value = new_value;
9 | if (stop) {
10 | const run_queue = !subscriber_queue.length;
11 | for (const subscriber of subscribers) {
12 | subscriber[1]();
13 | subscriber_queue.push(subscriber, value);
14 | }
15 | if (run_queue) {
16 | for (let i = 0; i < subscriber_queue.length; i += 2) {
17 | subscriber_queue[i][0](subscriber_queue[i + 1]);
18 | }
19 | subscriber_queue.length = 0;
20 | }
21 | }
22 | }
23 | }
24 | function update(fn) {
25 | set(fn(value));
26 | }
27 | function subscribe(run, invalidate = noop) {
28 | const subscriber = [run, invalidate];
29 | subscribers.add(subscriber);
30 | if (subscribers.size === 1) {
31 | stop = start(set) || noop;
32 | }
33 | run(value);
34 | return () => {
35 | subscribers.delete(subscriber);
36 | if (subscribers.size === 0) {
37 | stop();
38 | stop = null;
39 | }
40 | };
41 | }
42 | return { set, update, subscribe };
43 | }
44 | const current_page = writable(1);
45 | const media_type = writable("movie");
46 | const selected = writable(null);
47 | const show_name = writable("");
48 | const season_count = writable(0);
49 | const show_id = writable(0);
50 | const data = writable([]);
51 | const tv_genres = writable([]);
52 | const movie_genres = writable([]);
53 | export { media_type as a, show_name as b, current_page as c, data as d, show_id as e, season_count as f, movie_genres as m, selected as s, tv_genres as t, writable as w };
54 |
--------------------------------------------------------------------------------
/src/lib/components/Header.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/.svelte-kit/netlify/entry.js:
--------------------------------------------------------------------------------
1 | // TODO hardcoding the relative location makes this brittle
2 | import { init, render } from '../output/server/app.js';
3 |
4 | init();
5 |
6 | export async function handler(event) {
7 | const { path, httpMethod, headers, rawQuery, body, isBase64Encoded } = event;
8 |
9 | const query = new URLSearchParams(rawQuery);
10 |
11 | const encoding = isBase64Encoded ? 'base64' : headers['content-encoding'] || 'utf-8';
12 | const rawBody = typeof body === 'string' ? Buffer.from(body, encoding) : body;
13 |
14 | const rendered = await render({
15 | method: httpMethod,
16 | headers,
17 | path,
18 | query,
19 | rawBody
20 | });
21 |
22 | if (!rendered) {
23 | return {
24 | statusCode: 404,
25 | body: 'Not found'
26 | };
27 | }
28 |
29 | const partial_response = {
30 | statusCode: rendered.status,
31 | ...split_headers(rendered.headers)
32 | };
33 |
34 | if (rendered.body instanceof Uint8Array) {
35 | // Function responses should always be strings, and responses with binary
36 | // content should be base64 encoded and set isBase64Encoded to true.
37 | // https://github.com/netlify/functions/blob/main/src/function/response.d.ts
38 | return {
39 | ...partial_response,
40 | isBase64Encoded: true,
41 | body: Buffer.from(rendered.body).toString('base64')
42 | };
43 | }
44 |
45 | return {
46 | ...partial_response,
47 | body: rendered.body
48 | };
49 | }
50 |
51 | /**
52 | * Splits headers into two categories: single value and multi value
53 | * @param {Record} headers
54 | * @returns {{
55 | * headers: Record,
56 | * multiValueHeaders: Record
57 | * }}
58 | */
59 | function split_headers(headers) {
60 | const h = {};
61 | const m = {};
62 | for (const key in headers) {
63 | const value = headers[key];
64 | const target = Array.isArray(value) ? m : h;
65 | target[key] = value;
66 | }
67 | return {
68 | headers: h,
69 | multiValueHeaders: m
70 | };
71 | }
72 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/chunks/ProgressBar-f61e37f1.js:
--------------------------------------------------------------------------------
1 | import{S as w,i as M,s as C,e as _,k as D,t as I,c as b,a as y,d as v,n as V,g as k,b as i,f as A,D as u,h as N,H as S,z as j,X as H}from"./vendor-fc6286ba.js";function q(a){let r,s,n,t,f,h,o,g,l,m;return{c(){r=_("section"),s=_("div"),n=_("div"),t=_("canvas"),f=D(),h=_("div"),o=_("h2"),g=I(a[0]),l=_("span"),m=I("%"),this.h()},l(d){r=b(d,"SECTION",{id:!0,class:!0});var p=y(r);s=b(p,"DIV",{class:!0});var c=y(s);n=b(c,"DIV",{class:!0});var e=y(n);t=b(e,"CANVAS",{class:!0,width:!0,height:!0}),y(t).forEach(v),f=V(e),h=b(e,"DIV",{class:!0});var x=y(h);o=b(x,"H2",{class:!0});var P=y(o);g=k(P,a[0]),l=b(P,"SPAN",{class:!0});var E=y(l);m=k(E,"%"),E.forEach(v),P.forEach(v),x.forEach(v),e.forEach(v),c.forEach(v),p.forEach(v),this.h()},h(){i(t,"class","w-24 h-24"),i(t,"width","98"),i(t,"height","98"),i(l,"class","text-xl align-top"),i(o,"class","text-gray-200 text-3xl"),i(h,"class","absolute top-0 left-0 w-full h-full flex justify-center items-center"),i(n,"class","percent"),i(s,"class","box"),i(r,"id","progress"),i(r,"class","bg-gray-900 block rounded-full align-center relative w-24 h-24")},m(d,p){A(d,r,p),u(r,s),u(s,n),u(n,t),a[6](t),u(n,f),u(n,h),u(h,o),u(o,g),u(o,l),u(l,m)},p(d,[p]){p&1&&N(g,d[0])},i:S,o:S,d(d){d&&v(r),a[6](null)}}}function z(a,r,s){let{progress:n}=r,t,f,h,o,g,l,m;j(async()=>{d(t)});function d(c){var e=f.getContext("2d"),c=e.canvas.width/2,x=e.canvas.height/2;e.lineWidth=5,e.beginPath(),e.arc(c,x,40,Math.PI/180*270,Math.PI/180*(270+360)),e.strokeStyle=h,e.stroke(),e.strokeStyle=m,e.beginPath(),e.arc(c,x,40,Math.PI/180*270,Math.PI/180*(270+t*3.6)),e.stroke()}function p(c){H[c?"unshift":"push"](()=>{f=c,s(1,f)})}return a.$$set=c=>{"progress"in c&&s(2,n=c.progress)},a.$$.update=()=>{a.$$.dirty&4&&s(0,t=n*10),a.$$.dirty&1&&s(4,g=t<50?255:255-Math.floor((t-50)*2.55*2)),a.$$.dirty&1&&s(5,l=t>50?255:Math.floor(t*2.55*2)),a.$$.dirty&56&&(m="rgb("+g+","+l+","+o+")")},h="#2c2c2c",s(3,o=0),[t,f,n,o,g,l,p]}class O extends w{constructor(r){super();M(this,r,z,q,C,{progress:2})}}export{O as P};
2 |
--------------------------------------------------------------------------------
/src/lib/components/Genre.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 | Movies
11 |
12 |
13 |
14 | {#each $movie_genres as genre}
15 |
16 | {
21 | $selected = genre.id;
22 | goto(`/genre/movie/${genre.id}`);
23 | }}
24 | >
25 | {genre.name}
26 |
27 |
28 | {/each}
29 |
30 |
31 |
32 |
33 | Tv
34 |
35 |
36 |
37 | {#each $tv_genres as genre}
38 |
39 | {
43 | $selected = genre.id;
44 | goto(`/genre/tv/${genre.id}`);
45 | }}
46 | >
47 | {genre.name}
48 |
49 |
50 | {/each}
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/lib/utilities/Seasons.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
11 |
Season Information
12 | {#each tv_details.seasons as episode}
13 |
35 | {/each}
36 |
37 |
38 |
39 |
57 |
58 |
--------------------------------------------------------------------------------
/.svelte-kit/dev/runtime/app/stores.js:
--------------------------------------------------------------------------------
1 | import { getContext } from 'svelte';
2 | import { browser } from './env.js';
3 | import '../env.js';
4 |
5 | // TODO remove this (for 1.0? after 1.0?)
6 | let warned = false;
7 | function stores() {
8 | if (!warned) {
9 | console.error('stores() is deprecated; use getStores() instead');
10 | warned = true;
11 | }
12 | return getStores();
13 | }
14 |
15 | /**
16 | * @type {import('$app/stores').getStores}
17 | */
18 | const getStores = () => {
19 | const stores = getContext('__svelte__');
20 |
21 | return {
22 | page: {
23 | subscribe: stores.page.subscribe
24 | },
25 | navigating: {
26 | subscribe: stores.navigating.subscribe
27 | },
28 | // TODO remove this (for 1.0? after 1.0?)
29 | // @ts-expect-error - deprecated, not part of type definitions, but still callable
30 | get preloading() {
31 | console.error('stores.preloading is deprecated; use stores.navigating instead');
32 | return {
33 | subscribe: stores.navigating.subscribe
34 | };
35 | },
36 | session: stores.session
37 | };
38 | };
39 |
40 | /** @type {typeof import('$app/stores').page} */
41 | const page = {
42 | /** @param {(value: any) => void} fn */
43 | subscribe(fn) {
44 | const store = getStores().page;
45 | return store.subscribe(fn);
46 | }
47 | };
48 |
49 | /** @type {typeof import('$app/stores').navigating} */
50 | const navigating = {
51 | subscribe(fn) {
52 | const store = getStores().navigating;
53 | return store.subscribe(fn);
54 | }
55 | };
56 |
57 | /** @param {string} verb */
58 | const throw_error = (verb) => {
59 | throw new Error(
60 | browser
61 | ? `Cannot ${verb} session store before subscribing`
62 | : `Can only ${verb} session store in browser`
63 | );
64 | };
65 |
66 | /** @type {typeof import('$app/stores').session} */
67 | const session = {
68 | subscribe(fn) {
69 | const store = getStores().session;
70 |
71 | if (browser) {
72 | session.set = store.set;
73 | session.update = store.update;
74 | }
75 |
76 | return store.subscribe(fn);
77 | },
78 | set: () => throw_error('set'),
79 | update: () => throw_error('update')
80 | };
81 |
82 | export { getStores, navigating, page, session, stores };
83 |
--------------------------------------------------------------------------------
/.svelte-kit/build/runtime/app/stores.js:
--------------------------------------------------------------------------------
1 | import { getContext } from 'svelte';
2 | import { browser } from './env.js';
3 | import '../env.js';
4 |
5 | const ssr = !browser;
6 |
7 | // TODO remove this (for 1.0? after 1.0?)
8 | let warned = false;
9 | function stores() {
10 | if (!warned) {
11 | console.error('stores() is deprecated; use getStores() instead');
12 | warned = true;
13 | }
14 | return getStores();
15 | }
16 |
17 | /**
18 | * @type {import('$app/stores').getStores}
19 | */
20 | const getStores = () => {
21 | const stores = getContext('__svelte__');
22 |
23 | return {
24 | page: {
25 | subscribe: stores.page.subscribe
26 | },
27 | navigating: {
28 | subscribe: stores.navigating.subscribe
29 | },
30 | // TODO remove this (for 1.0? after 1.0?)
31 | // @ts-expect-error - deprecated, not part of type definitions, but still callable
32 | get preloading() {
33 | console.error('stores.preloading is deprecated; use stores.navigating instead');
34 | return {
35 | subscribe: stores.navigating.subscribe
36 | };
37 | },
38 | session: stores.session
39 | };
40 | };
41 |
42 | /** @type {typeof import('$app/stores').page} */
43 | const page = {
44 | /** @param {(value: any) => void} fn */
45 | subscribe(fn) {
46 | const store = getStores().page;
47 | return store.subscribe(fn);
48 | }
49 | };
50 |
51 | /** @type {typeof import('$app/stores').navigating} */
52 | const navigating = {
53 | subscribe(fn) {
54 | const store = getStores().navigating;
55 | return store.subscribe(fn);
56 | }
57 | };
58 |
59 | /** @param {string} verb */
60 | const error = (verb) => {
61 | throw new Error(
62 | ssr
63 | ? `Can only ${verb} session store in browser`
64 | : `Cannot ${verb} session store before subscribing`
65 | );
66 | };
67 |
68 | /** @type {typeof import('$app/stores').session} */
69 | const session = {
70 | subscribe(fn) {
71 | const store = getStores().session;
72 |
73 | if (!ssr) {
74 | session.set = store.set;
75 | session.update = store.update;
76 | }
77 |
78 | return store.subscribe(fn);
79 | },
80 | set: () => error('set'),
81 | update: () => error('update')
82 | };
83 |
84 | export { getStores, navigating, page, session, stores };
85 |
--------------------------------------------------------------------------------
/src/lib/pages/MainSection.svelte:
--------------------------------------------------------------------------------
1 |
64 |
65 |
66 |
67 |
68 | {#if $media_type === 'person'}
69 |
70 | {:else if $media_type === 'movie'}
71 |
72 | {:else if $media_type === 'tv'}
73 |
74 | {/if}
75 |
76 | {#if $current_page < total_pages}
77 | loadMorePages()} />
78 | {/if}
79 |
80 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## SvelteKit Movies
2 |
3 | Note: Majority credit for this implementation goes to [WayneMorganUK](https://github.com/WayneMorganUK/sveltekit-movie-app).
4 |
5 | ## please note this app will not work unles you provide your own TMDB api key
6 |
7 | ## adding environment variables
8 |
9 | in dev mode create a .env file similar to the example.
10 | You will need your own [TMDB api key ](https://www.themoviedb.org/faq/api)
11 |
12 |
13 | ## create-svelte
14 |
15 | Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte);
16 |
17 | ## Creating a project
18 |
19 | If you're seeing this, you've probably already done this step. Congrats!
20 |
21 | ```bash
22 | # create a new project in the current directory
23 | npm init svelte@next
24 |
25 | # create a new project in my-app
26 | npm init svelte@next my-app
27 | ```
28 |
29 | > Note: the `@next` is temporary
30 |
31 | ## Developing
32 |
33 | Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
34 |
35 | ```bash
36 | npm run dev
37 |
38 | # or start the server and open the app in a new browser tab
39 | npm run dev -- --open
40 | ```
41 |
42 | ## Building
43 |
44 | Svelte apps are built with _adapters_, which optimise your project for deployment to different environments.
45 |
46 | By default, `npm run build` will generate a Node app that you can run with `node build`. To use a different adapter, add it to the `devDependencies` in `package.json` making sure to specify the version as `next` and update your `svelte.config.cjs` to [specify your chosen adapter](https://kit.svelte.dev/docs#configuration-adapter). The following official adapters are available:
47 |
48 | - [@sveltejs/adapter-node](https://github.com/sveltejs/kit/tree/master/packages/adapter-node)
49 | - [@sveltejs/adapter-static](https://github.com/sveltejs/kit/tree/master/packages/adapter-static)
50 | - [@sveltejs/adapter-netlify](https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify)
51 | - [@sveltejs/adapter-vercel](https://github.com/sveltejs/kit/tree/master/packages/adapter-vercel)
52 | - ...more soon
53 |
54 | [See the adapter documentation for more detail](https://kit.svelte.dev/docs#adapters)
55 |
--------------------------------------------------------------------------------
/tailwind.config.cjs:
--------------------------------------------------------------------------------
1 | const plugin = require('tailwindcss/plugin');
2 | const config = {
3 | content: ['./src/**/*.{html,js,svelte,ts}'],
4 | theme: {
5 | extend: {
6 | borderColor: {
7 | skin: {
8 | border: 'var(--color-border)'
9 | }
10 | },
11 | fill: {
12 | current: 'currentColor'
13 | },
14 | textColor: {
15 | skin: {
16 | base: 'var(--color-text-base)',
17 | muted: 'var(--color-text-muted)',
18 | inverted: 'var(--color-text-inverted)',
19 | selected: 'var(--color-text-selected)',
20 | mutedinverted: 'var(--color-text-muted-inverted)'
21 | }
22 | },
23 | backgroundColor: {
24 | skin: {
25 | primary: 'var(--color-primary)',
26 | secondary: 'var(--color-secondary)',
27 | tertiary: 'var(--color-tertiary)',
28 | bg: 'var(--color-bg)',
29 | border: 'var(--color-border)',
30 | selected: 'var(--color-selected)'
31 | }
32 | },
33 | gradientColorStops: {
34 | skin: {
35 | primary: 'var(--color-primary)',
36 | secondary: 'var(--color-secondary)',
37 | tertiary: 'var(--color-tertiary)',
38 | bg: 'var(--color-bg)',
39 | border: 'var(--color-border)'
40 | }
41 | },
42 | fontFamily: {
43 | body: ['Raleway']
44 | },
45 |
46 | spacing: {
47 | 5: '1.125rem',
48 | 18: '4.5rem',
49 | 42: '10.5rem',
50 | 66: '16.5rem',
51 | 72: '18rem',
52 | 90: '22.5rem',
53 | 100: '25rem',
54 | 104: '26rem',
55 | 108: '27rem',
56 | 112: '28rem',
57 | 120: '30rem',
58 | '16/9': '56.25%'
59 | },
60 | scale: {
61 | 60: '0.6',
62 | 44: '0.44'
63 | },
64 | gridTemplateRows: {
65 | auto: 'repeat(auto-fill, minmax(0,auto))'
66 | }
67 | }
68 | },
69 | plugins: [
70 | plugin(function ({ addUtilities }) {
71 | const newUtilities = {
72 | '.preserve-3d': {
73 | 'transform-style': 'preserve-3d'
74 | },
75 | '.perspective-1000': {
76 | perspective: '1000px'
77 | },
78 | '.backface-hidden': {
79 | 'backface-visibility': 'hidden'
80 | },
81 | '.rotate-y-0': {
82 | transform: 'rotateY(0deg)'
83 | },
84 | '.rotate-y-180': {
85 | transform: 'rotateY(180deg)'
86 | }
87 | };
88 |
89 | addUtilities(newUtilities, ['group-hover']);
90 | }),
91 | require('@tailwindcss/line-clamp')
92 | ]
93 | };
94 |
95 | module.exports = config;
96 |
--------------------------------------------------------------------------------
/.svelte-kit/dev/generated/manifest.js:
--------------------------------------------------------------------------------
1 | const c = [
2 | () => import("..\\..\\..\\src\\routes\\__layout.svelte"),
3 | () => import("..\\..\\..\\src\\routes\\__error.svelte"),
4 | () => import("..\\..\\..\\src\\routes\\index.svelte"),
5 | () => import("..\\..\\..\\src\\routes\\NotFound.svelte"),
6 | () => import("..\\..\\..\\src\\routes\\trending\\[media].svelte"),
7 | () => import("..\\..\\..\\src\\routes\\episode\\[id]\\[season_number]\\[episode_number].svelte"),
8 | () => import("..\\..\\..\\src\\routes\\seasons\\[id]\\[season_number].svelte"),
9 | () => import("..\\..\\..\\src\\routes\\person\\[id].svelte"),
10 | () => import("..\\..\\..\\src\\routes\\search\\[id].svelte"),
11 | () => import("..\\..\\..\\src\\routes\\genre\\[media]\\[id].svelte"),
12 | () => import("..\\..\\..\\src\\routes\\movie\\[id].svelte"),
13 | () => import("..\\..\\..\\src\\routes\\tv\\[id].svelte")
14 | ];
15 |
16 | const d = decodeURIComponent;
17 |
18 | export const routes = [
19 | // src/routes/index.svelte
20 | [/^\/$/, [c[0], c[2]], [c[1]]],
21 |
22 | // src/routes/NotFound.svelte
23 | [/^\/NotFound\/?$/, [c[0], c[3]], [c[1]]],
24 |
25 | // src/routes/trending/[media].svelte
26 | [/^\/trending\/([^/]+?)\/?$/, [c[0], c[4]], [c[1]], (m) => ({ media: d(m[1])})],
27 |
28 | // src/routes/episode/[id]/[season_number]/[episode_number].svelte
29 | [/^\/episode\/([^/]+?)\/([^/]+?)\/([^/]+?)\/?$/, [c[0], c[5]], [c[1]], (m) => ({ id: d(m[1]), season_number: d(m[2]), episode_number: d(m[3])})],
30 |
31 | // src/routes/seasons/[id]/[season_number].svelte
32 | [/^\/seasons\/([^/]+?)\/([^/]+?)\/?$/, [c[0], c[6]], [c[1]], (m) => ({ id: d(m[1]), season_number: d(m[2])})],
33 |
34 | // src/routes/person/[id].svelte
35 | [/^\/person\/([^/]+?)\/?$/, [c[0], c[7]], [c[1]], (m) => ({ id: d(m[1])})],
36 |
37 | // src/routes/search/[id].svelte
38 | [/^\/search\/([^/]+?)\/?$/, [c[0], c[8]], [c[1]], (m) => ({ id: d(m[1])})],
39 |
40 | // src/routes/genre/[media]/[id].svelte
41 | [/^\/genre\/([^/]+?)\/([^/]+?)\/?$/, [c[0], c[9]], [c[1]], (m) => ({ media: d(m[1]), id: d(m[2])})],
42 |
43 | // src/routes/movie/[id].svelte
44 | [/^\/movie\/([^/]+?)\/?$/, [c[0], c[10]], [c[1]], (m) => ({ id: d(m[1])})],
45 |
46 | ,
47 |
48 | ,
49 |
50 | ,
51 |
52 | ,
53 |
54 | // src/routes/tv/[id].svelte
55 | [/^\/tv\/([^/]+?)\/?$/, [c[0], c[11]], [c[1]], (m) => ({ id: d(m[1])})]
56 | ];
57 |
58 | // we import the root layout/error components eagerly, so that
59 | // connectivity errors after initialisation don't nuke the app
60 | export const fallback = [c[0](), c[1]()];
--------------------------------------------------------------------------------
/.svelte-kit/dev/runtime/app/navigation.js:
--------------------------------------------------------------------------------
1 | import { renderer, router as router$1 } from '../internal/singletons.js';
2 | import { g as get_base_uri } from '../chunks/utils.js';
3 |
4 | const router = /** @type {import('../client/router').Router} */ (router$1);
5 |
6 | /**
7 | * @param {string} name
8 | */
9 | function guard(name) {
10 | return () => {
11 | throw new Error(`Cannot call ${name}(...) on the server`);
12 | };
13 | }
14 |
15 | const disableScrollHandling = import.meta.env.SSR
16 | ? guard('disableScrollHandling')
17 | : disableScrollHandling_;
18 | const goto = import.meta.env.SSR ? guard('goto') : goto_;
19 | const invalidate = import.meta.env.SSR ? guard('invalidate') : invalidate_;
20 | const prefetch = import.meta.env.SSR ? guard('prefetch') : prefetch_;
21 | const prefetchRoutes = import.meta.env.SSR ? guard('prefetchRoutes') : prefetchRoutes_;
22 | const beforeNavigate = import.meta.env.SSR ? () => {} : beforeNavigate_;
23 | const afterNavigate = import.meta.env.SSR ? () => {} : afterNavigate_;
24 |
25 | /**
26 | * @type {import('$app/navigation').goto}
27 | */
28 | async function disableScrollHandling_() {
29 | renderer.disable_scroll_handling();
30 | }
31 |
32 | /**
33 | * @type {import('$app/navigation').goto}
34 | */
35 | async function goto_(href, opts) {
36 | return router.goto(href, opts, []);
37 | }
38 |
39 | /**
40 | * @type {import('$app/navigation').invalidate}
41 | */
42 | async function invalidate_(resource) {
43 | const { href } = new URL(resource, location.href);
44 | return router.renderer.invalidate(href);
45 | }
46 |
47 | /**
48 | * @type {import('$app/navigation').prefetch}
49 | */
50 | function prefetch_(href) {
51 | return router.prefetch(new URL(href, get_base_uri(document)));
52 | }
53 |
54 | /**
55 | * @type {import('$app/navigation').prefetchRoutes}
56 | */
57 | async function prefetchRoutes_(pathnames) {
58 | const matching = pathnames
59 | ? router.routes.filter((route) => pathnames.some((pathname) => route[0].test(pathname)))
60 | : router.routes;
61 |
62 | const promises = matching.map((r) => Promise.all(r[1].map((load) => load())));
63 |
64 | await Promise.all(promises);
65 | }
66 |
67 | /**
68 | * @type {import('$app/navigation').beforeNavigate}
69 | */
70 | function beforeNavigate_(fn) {
71 | if (router) router.before_navigate(fn);
72 | }
73 |
74 | /**
75 | * @type {import('$app/navigation').afterNavigate}
76 | */
77 | function afterNavigate_(fn) {
78 | if (router) router.after_navigate(fn);
79 | }
80 |
81 | export { afterNavigate, beforeNavigate, disableScrollHandling, goto, invalidate, prefetch, prefetchRoutes };
82 |
--------------------------------------------------------------------------------
/static/person.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.svelte-kit/build/generated/manifest.js:
--------------------------------------------------------------------------------
1 | const c = [
2 | () => import("..\\..\\..\\src\\routes\\__layout.svelte"),
3 | () => import("..\\..\\..\\src\\routes\\__error.svelte"),
4 | () => import("..\\..\\..\\src\\routes\\index.svelte"),
5 | () => import("..\\..\\..\\src\\routes\\NotFound.svelte"),
6 | () => import("..\\..\\..\\src\\routes\\trending\\[media].svelte"),
7 | () => import("..\\..\\..\\src\\routes\\episode\\[id]\\[season_number]\\[episode_number].svelte"),
8 | () => import("..\\..\\..\\src\\routes\\seasons\\[id]\\[season_number].svelte"),
9 | () => import("..\\..\\..\\src\\routes\\person\\[id].svelte"),
10 | () => import("..\\..\\..\\src\\routes\\search\\[id].svelte"),
11 | () => import("..\\..\\..\\src\\routes\\genre\\[media]\\[id].svelte"),
12 | () => import("..\\..\\..\\src\\routes\\movie\\[id].svelte"),
13 | () => import("..\\..\\..\\src\\routes\\tv\\[id].svelte")
14 | ];
15 |
16 | const d = decodeURIComponent;
17 |
18 | export const routes = [
19 | // src/routes/index.svelte
20 | [/^\/$/, [c[0], c[2]], [c[1]]],
21 |
22 | // src/routes/NotFound.svelte
23 | [/^\/NotFound\/?$/, [c[0], c[3]], [c[1]]],
24 |
25 | ,
26 |
27 | ,
28 |
29 | ,
30 |
31 | // src/routes/trending/[media].svelte
32 | [/^\/trending\/([^/]+?)\/?$/, [c[0], c[4]], [c[1]], (m) => ({ media: d(m[1])})],
33 |
34 | // src/routes/episode/[id]/[season_number]/[episode_number].svelte
35 | [/^\/episode\/([^/]+?)\/([^/]+?)\/([^/]+?)\/?$/, [c[0], c[5]], [c[1]], (m) => ({ id: d(m[1]), season_number: d(m[2]), episode_number: d(m[3])})],
36 |
37 | // src/routes/seasons/[id]/[season_number].svelte
38 | [/^\/seasons\/([^/]+?)\/([^/]+?)\/?$/, [c[0], c[6]], [c[1]], (m) => ({ id: d(m[1]), season_number: d(m[2])})],
39 |
40 | // src/routes/person/[id].svelte
41 | [/^\/person\/([^/]+?)\/?$/, [c[0], c[7]], [c[1]], (m) => ({ id: d(m[1])})],
42 |
43 | // src/routes/search/[id].svelte
44 | [/^\/search\/([^/]+?)\/?$/, [c[0], c[8]], [c[1]], (m) => ({ id: d(m[1])})],
45 |
46 | // src/routes/genre/[media]/[id].svelte
47 | [/^\/genre\/([^/]+?)\/([^/]+?)\/?$/, [c[0], c[9]], [c[1]], (m) => ({ media: d(m[1]), id: d(m[2])})],
48 |
49 | // src/routes/movie/[id].svelte
50 | [/^\/movie\/([^/]+?)\/?$/, [c[0], c[10]], [c[1]], (m) => ({ id: d(m[1])})],
51 |
52 | ,
53 |
54 | ,
55 |
56 | ,
57 |
58 | ,
59 |
60 | ,
61 |
62 | ,
63 |
64 | ,
65 |
66 | ,
67 |
68 | ,
69 |
70 | ,
71 |
72 | ,
73 |
74 | ,
75 |
76 | ,
77 |
78 | ,
79 |
80 | // src/routes/tv/[id].svelte
81 | [/^\/tv\/([^/]+?)\/?$/, [c[0], c[11]], [c[1]], (m) => ({ id: d(m[1])})]
82 | ];
83 |
84 | // we import the root layout/error components eagerly, so that
85 | // connectivity errors after initialisation don't nuke the app
86 | export const fallback = [c[0](), c[1]()];
--------------------------------------------------------------------------------
/src/lib/utilities/ToggleDarkMode.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
17 | {#if $theme === 'dark'}
18 |
19 |
20 |
21 |
22 |
23 | {:else}
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | {/if}
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[season_number]-873eb4f0.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, e as each, a as add_attribute, b as escape, s as subscribe, v as validate_component } from "./app-14a936dc.js";
2 | import { p as page } from "./stores-bd543f9c.js";
3 | const IMAGE_API = "https://image.tmdb.org/t/p/w500/";
4 | const Season = create_ssr_component(($$result, $$props, $$bindings, slots) => {
5 | let { season_details } = $$props;
6 | let { tv_id } = $$props;
7 | if ($$props.season_details === void 0 && $$bindings.season_details && season_details !== void 0)
8 | $$bindings.season_details(season_details);
9 | if ($$props.tv_id === void 0 && $$bindings.tv_id && tv_id !== void 0)
10 | $$bindings.tv_id(tv_id);
11 | return `
12 |
13 | ${season_details.id ? `
Season Information
14 | ${each(season_details.episodes, (episode) => `
`)}` : ``}
21 | `;
22 | });
23 | async function load({ fetch, page: page2 }) {
24 | const res = await fetch("../../api/getSeason", {
25 | headers: { "Content-Type": "application/json" },
26 | method: "POST",
27 | body: JSON.stringify({
28 | id: page2.params.id,
29 | season_number: page2.params.season_number
30 | })
31 | });
32 | const datas = await res.json();
33 | const season_details = await datas.res;
34 | return { props: { season_details } };
35 | }
36 | const U5Bseason_numberu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
37 | let $page, $$unsubscribe_page;
38 | $$unsubscribe_page = subscribe(page, (value) => $page = value);
39 | let { season_details } = $$props;
40 | let tv_id = $page.params.id;
41 | if ($$props.season_details === void 0 && $$bindings.season_details && season_details !== void 0)
42 | $$bindings.season_details(season_details);
43 | $$unsubscribe_page();
44 | return `${validate_component(Season, "Season").$$render($$result, { season_details, tv_id }, {}, {})}`;
45 | });
46 | export { U5Bseason_numberu5D as default, load };
47 |
--------------------------------------------------------------------------------
/src/lib/utilities/KnownFor.svelte:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 | {#if films}
26 |
27 | Movies
28 |
29 |
32 | {#each films as movie}
33 |
52 | {/each}
53 |
54 | {/if}
55 | {#if tv}
56 |
57 | TV
58 |
59 |
62 | {#each tv as show}
63 |
82 | {/each}
83 |
84 | {/if}
85 |
86 |
--------------------------------------------------------------------------------
/src/lib/pages/Person.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
13 | {#if person.profile_path}
14 |
19 | {:else}
20 |
25 | {/if}
26 |
{person.name}
27 |
28 |
Personal Info
29 |
Known For
30 |
{person.known_for_department}
31 |
Gender
32 | {#if person.gender === 2}
33 |
Male
34 | {:else}
35 |
Female
36 | {/if}
37 |
Birthdate
38 | {#if person.birthday}
39 |
{person.birthday}
40 | {:else}
41 |
Unknown
42 | {/if}
43 |
Place of Birth
44 | {#if person.place_of_birth}
45 |
{person.place_of_birth}
46 | {:else}
47 |
Unknown
48 | {/if}
49 | {#if person.also_known_as && person.also_known_as.length}
50 |
Also Known As
51 | {#each person.also_known_as as alias}
52 |
{alias}
53 | {/each}
54 | {/if}
55 |
56 |
57 |
58 |
61 |
62 |
{person.name}
63 |
Biography
64 |
{person.biography}
65 |
66 |
67 |
70 |
71 |
Known For
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/lib/pages/Episode.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
14 | {#if episode_details.id}
15 |
Episode Information
16 |
17 |
18 |
25 |
26 |
27 |
28 |
Season: {episode_details.season_number} Episode: {episode_details.episode_number}
29 | Episode Name: {episode_details.name}
30 | Air Date: {episode_details.air_date}
31 | Overview:
32 | {episode_details.overview}
33 |
34 |
35 |
36 | {#if episode_details.guest_stars.length}
37 |
38 |
Guest Stars
39 |
42 | {#each episode_details.guest_stars as guest_star}
43 |
46 |
47 |
54 |
55 |
Character {guest_star.character}
56 |
Name {guest_star.name}
57 |
58 | {/each}
59 |
60 |
61 | {/if}
62 |
63 | {#if episode_details.crew.length}
64 |
65 |
Crew
66 |
69 | {#each episode_details.crew as crew_member}
70 |
73 |
74 |
81 |
82 |
{crew_member.job}
83 |
{crew_member.name}
84 |
85 | {/each}
86 |
87 |
88 | {/if}
89 | {/if}
90 |
91 |
92 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[episode_number]-47200495.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, a as add_attribute, b as escape, e as each, v as validate_component } from "./app-14a936dc.js";
2 | const IMAGE_API = "https://image.tmdb.org/t/p/original";
3 | const Episode = create_ssr_component(($$result, $$props, $$bindings, slots) => {
4 | let { episode_details } = $$props;
5 | if ($$props.episode_details === void 0 && $$bindings.episode_details && episode_details !== void 0)
6 | $$bindings.episode_details(episode_details);
7 | return `
8 |
9 | ${episode_details.id ? `
Episode Information
10 |
11 |
12 |
Season: ${escape(episode_details.season_number)} Episode: ${escape(episode_details.episode_number)}
13 | Episode Name: ${escape(episode_details.name)}
14 | Air Date: ${escape(episode_details.air_date)}
15 | Overview:
16 | ${escape(episode_details.overview)}
17 |
18 | ${episode_details.guest_stars.length ? `
Guest Stars
19 |
${each(episode_details.guest_stars, (guest_star) => `
20 |
Character ${escape(guest_star.character)}
21 |
Name ${escape(guest_star.name)}
22 |
`)}
` : ``}
23 |
24 | ${episode_details.crew.length ? `
Crew
25 |
${each(episode_details.crew, (crew_member) => `
26 |
${escape(crew_member.job)}
27 |
${escape(crew_member.name)}
28 |
`)}
` : ``}` : ``}
`;
29 | });
30 | async function load({ fetch, page }) {
31 | const res = await fetch("../../../api/getEpisode", {
32 | headers: { "Content-Type": "application/json" },
33 | method: "POST",
34 | body: JSON.stringify({
35 | id: page.params.id,
36 | season_number: page.params.season_number,
37 | episode_number: page.params.episode_number
38 | })
39 | });
40 | const datas = await res.json();
41 | const episode_details = await datas.res;
42 | return { props: { episode_details } };
43 | }
44 | const U5Bepisode_numberu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
45 | let { episode_details } = $$props;
46 | if ($$props.episode_details === void 0 && $$bindings.episode_details && episode_details !== void 0)
47 | $$bindings.episode_details(episode_details);
48 | return `${validate_component(Episode, "Episode").$$render($$result, { episode_details }, {}, {})}`;
49 | });
50 | export { U5Bepisode_numberu5D as default, load };
51 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/Cast-31f4e4f3.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, b as escape, e as each, a as add_attribute } from "./app-14a936dc.js";
2 | var Spinner_svelte_svelte_type_style_lang = "";
3 | const css = {
4 | code: "div.svelte-11hc8a6{-webkit-animation:svelte-11hc8a6-wave .8s ease-in-out infinite alternate;animation:svelte-11hc8a6-wave .8s ease-in-out infinite alternate}div.svelte-11hc8a6:first-of-type{-webkit-animation-delay:-.4s;animation-delay:-.4s}div.svelte-11hc8a6:nth-of-type(2){-webkit-animation-delay:-.2s;animation-delay:-.2s}@-webkit-keyframes svelte-11hc8a6-wave{0%{transform:translateY(-100%)}to{transform:translateY(100%)}}@keyframes svelte-11hc8a6-wave{0%{transform:translateY(-100%)}to{transform:translateY(100%)}}",
5 | map: null
6 | };
7 | const Spinner = create_ssr_component(($$result, $$props, $$bindings, slots) => {
8 | $$result.css.add(css);
9 | return ``;
13 | });
14 | const Modal = create_ssr_component(($$result, $$props, $$bindings, slots) => {
15 | let { trailer_id } = $$props;
16 | let shown = false;
17 | function show() {
18 | shown = true;
19 | }
20 | function hide() {
21 | shown = false;
22 | }
23 | if ($$props.trailer_id === void 0 && $$bindings.trailer_id && trailer_id !== void 0)
24 | $$bindings.trailer_id(trailer_id);
25 | if ($$props.show === void 0 && $$bindings.show && show !== void 0)
26 | $$bindings.show(show);
27 | if ($$props.hide === void 0 && $$bindings.hide && hide !== void 0)
28 | $$bindings.hide(hide);
29 | return `${shown ? `` : ``}`;
32 | });
33 | const IMAGE_API = "https://image.tmdb.org/t/p/w200/";
34 | const Cast = create_ssr_component(($$result, $$props, $$bindings, slots) => {
35 | let { cast = [] } = $$props;
36 | if ($$props.cast === void 0 && $$bindings.cast && cast !== void 0)
37 | $$bindings.cast(cast);
38 | return `${cast.length ? `Top Billed Cast
39 |
40 | ${each(cast, (person) => `
`)}
` : ``}`;
45 | });
46 | export { Cast as C, Modal as M, Spinner as S };
47 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/seasons/[id]/[season_number].svelte-7534c8b0.js:
--------------------------------------------------------------------------------
1 | import{S as z,i as F,s as Q,e as u,t as k,k as E,l as R,c as m,a as v,g as I,d,n as S,b as h,f as H,D as c,O as W,h as B,K as te,H as X,j as ae,m as le,o as ne,x as ie,u as oe,v as re,L as ce}from"../../../chunks/vendor-fc6286ba.js";import{p as fe}from"../../../chunks/stores-462c50b9.js";function Y(n,s,l){const e=n.slice();return e[2]=s[l],e}function Z(n){let s,l,e,a,i=n[0].episodes,o=[];for(let t=0;t{"season_details"in i&&l(0,e=i.season_details),"tv_id"in i&&l(1,a=i.tv_id)},[e,a]}class he extends z{constructor(s){super();F(this,s,_e,de,Q,{season_details:0,tv_id:1})}}function ue(n){let s,l;return s=new he({props:{season_details:n[0],tv_id:n[1]}}),{c(){ae(s.$$.fragment)},l(e){le(s.$$.fragment,e)},m(e,a){ne(s,e,a),l=!0},p(e,[a]){const i={};a&1&&(i.season_details=e[0]),s.$set(i)},i(e){l||(ie(s.$$.fragment,e),l=!0)},o(e){oe(s.$$.fragment,e),l=!1},d(e){re(s,e)}}}async function be({fetch:n,page:s}){return{props:{season_details:await(await(await n("../../api/getSeason",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:s.params.id,season_number:s.params.season_number})})).json()).res}}}function me(n,s,l){let e;ce(n,fe,o=>l(2,e=o));let{season_details:a}=s,i=e.params.id;return n.$$set=o=>{"season_details"in o&&l(0,a=o.season_details)},[a,i]}class ge extends z{constructor(s){super();F(this,s,me,ue,Q,{season_details:0})}}export{ge as default,be as load};
2 |
--------------------------------------------------------------------------------
/src/lib/utilities/Pagination.svelte:
--------------------------------------------------------------------------------
1 |
61 |
62 | {#if total_pages > 1}
63 |
123 | {/if}
124 |
125 |
133 |
--------------------------------------------------------------------------------
/src/lib/utilities/Selector.svelte:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
27 |
28 |
29 |
30 |
31 | Movies
32 |
33 |
34 |
35 |
36 |
37 |
38 |
44 |
45 |
46 |
47 |
48 | Tv
49 |
50 |
51 |
52 |
53 |
54 |
55 |
61 |
62 |
63 |
64 |
65 | People
66 |
67 |
68 |
69 | {#key $selected}
70 |
71 |
72 |
76 |
77 |
78 |
79 |
80 | Genres
81 |
82 |
87 |
88 |
89 | {/key}
90 |
--------------------------------------------------------------------------------
/src/lib/pages/MovieMedia.svelte:
--------------------------------------------------------------------------------
1 |
26 |
27 | {#if movie_details.id && trailer_details}
28 |
33 |
37 |
40 |
41 |
48 |
49 |
50 |
51 |
52 | {movie_details.title}
53 |
54 | {movie_details.release_date ? movie_details.release_date.substring(0, 4) : ''}
55 |
56 |
57 | {#if movie_details.vote_average}
58 |
63 | {/if}
64 |
65 |
66 |
67 | {movie_details.release_date ? movie_details.release_date : 'No Date Available'}
68 | •
69 |
70 |
71 | {#each movie_details.genres as { id, name }, i}
72 |
{name}
73 | {#if i !== movie_details.genres.length - 1}
| {/if}
74 | {/each}
75 |
76 | {#if 'runtime' in movie_details}
77 |
78 | • {(movie_details.runtime -
79 | (movie_details.runtime % 60)) /
80 | 60}h {movie_details.runtime % 60}m
81 |
82 | {/if}
83 |
84 |
85 |
88 | {#if trailer_details.length > 0}
89 | {#each trailer_details as trailer}
90 |
91 |
showModal(trailer.key, trailer.site)}
93 | title={trailer.name}
94 | use:tooltip
95 | >
96 |
100 |
101 |
102 | {/each}
103 |
104 | {:else}
105 |
106 |
No Trailer Available
107 |
108 | {/if}
109 |
110 |
111 |
{movie_details.tagline}
112 |
Overview
113 |
{movie_details.overview}
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | {:else}
123 |
124 | {/if}
125 |
--------------------------------------------------------------------------------
/src/lib/pages/TvMedia.svelte:
--------------------------------------------------------------------------------
1 |
37 |
38 | {#if tv_details.id && trailer_details}
39 |
44 |
48 |
51 |
52 |
59 |
60 |
61 |
62 |
63 | {tv_details.name}
64 |
65 | {tv_details ? tv_details.first_air_date.substring(0, 4) : ''}
66 |
67 |
68 | {#if tv_details.vote_average}
69 |
74 | {/if}
75 |
76 |
77 | {'first_air_date' in tv_details ? tv_details.first_air_date : 'No Date Available'}
78 | •
79 |
80 |
81 | {#each tv_details.genres as { id, name }, i}
82 |
{name}
83 | {#if i !== tv_details.genres.length - 1}
| {/if}
84 | {/each}
85 |
86 |
87 |
88 |
91 | {#if trailer_details.length > 0}
92 | {#each trailer_details as trailer}
93 |
94 |
showModal(trailer.key, trailer.site)}
96 | title={trailer.name}
97 | use:tooltip
98 | >
99 |
103 |
104 |
105 | {/each}
106 |
107 | {:else}
108 |
109 |
No Trailer Available
110 |
111 | {/if}
112 |
113 |
114 |
{tv_details.tagline}
115 |
Overview
116 |
{tv_details.overview}
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | {#if $media_type === 'tv'}
128 | {#key tv_details}
129 |
130 | {/key}
131 | {/if}
132 | {:else}
133 |
134 | {/if}
135 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/chunks/Cast-6bfa9e9c.js:
--------------------------------------------------------------------------------
1 | import{S as M,i as N,s as $,e as _,k as I,c as p,a as b,d as o,n as C,b as a,f as y,D as u,H as k,O as V,F as J,l as T,t as A,g as O,h as q,K as L}from"./vendor-fc6286ba.js";function Q(n){let e,l,t,s,d,h,i,r;return{c(){e=_("section"),l=_("section"),t=_("div"),s=_("div"),d=I(),h=_("div"),i=I(),r=_("div"),this.h()},l(f){e=p(f,"SECTION",{id:!0,class:!0});var c=b(e);l=p(c,"SECTION",{class:!0});var v=b(l);t=p(v,"DIV",{class:!0});var m=b(t);s=p(m,"DIV",{class:!0}),b(s).forEach(o),d=C(m),h=p(m,"DIV",{class:!0}),b(h).forEach(o),i=C(m),r=p(m,"DIV",{class:!0}),b(r).forEach(o),m.forEach(o),v.forEach(o),c.forEach(o),this.h()},h(){a(s,"class","w-3 h-3 rounded-full bg-primary -translate-x-1/2 -translate-y-full svelte-11hc8a6"),a(h,"class","w-3 h-3 rounded-full bg-primary -translate-x-1/2 -translate-y-full svelte-11hc8a6"),a(r,"class","w-3 h-3 rounded-full bg-primary -translate-x-1/2 -translate-y-full svelte-11hc8a6"),a(t,"class","inline-flex flex-nowrap flex-row items-center justify-between mx-auto w-12 svelte-11hc8a6"),a(l,"class","flex absolute items-center h-8 top-1/2 left-1/2 transform -translate-x-1/2 "),a(e,"id","spinner"),a(e,"class","w-full h-full m-auto")},m(f,c){y(f,e,c),u(e,l),u(l,t),u(t,s),u(t,d),u(t,h),u(t,i),u(t,r)},p:k,i:k,o:k,d(f){f&&o(e)}}}class le extends M{constructor(e){super();N(this,e,null,Q,$,{})}}function B(n){let e,l,t,s,d,h,i,r,f,c;return{c(){e=_("section"),l=_("div"),t=_("iframe"),s=_("track"),h=I(),i=_("div"),r=_("i"),this.h()},l(v){e=p(v,"SECTION",{id:!0,class:!0});var m=b(e);l=p(m,"DIV",{class:!0});var D=b(l);t=p(D,"IFRAME",{class:!0,title:!0,src:!0,allow:!0});var S=b(t);s=p(S,"TRACK",{kind:!0}),S.forEach(o),D.forEach(o),h=C(m),i=p(m,"DIV",{class:!0});var E=b(i);r=p(E,"I",{class:!0,"aria-hidden":!0}),b(r).forEach(o),E.forEach(o),m.forEach(o),this.h()},h(){s.default=!0,a(s,"kind","captions"),a(t,"class","iframe absolute top-0 left-0 w-full h-full bg-contain"),a(t,"title","Trailer"),V(t.src,d="https://www.youtube.com/embed/"+n[0]+"?rel=0")||a(t,"src",d),a(t,"allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),t.allowFullscreen=!0,a(l,"class","absolute top-0 left-0 w-full h-full bg-contain"),a(r,"class","fa fa-window-close"),a(r,"aria-hidden","true"),a(i,"class","close absolute top-1 left-1 text-red-900 text-4xl xl:text-5xl hover:font-bold"),a(e,"id","trailer"),a(e,"class","top-0 left-0 bottom-0 right-0 bg-gray-800 bg-opacity-60 fixed z-50")},m(v,m){y(v,e,m),u(e,l),u(l,t),u(t,s),u(e,h),u(e,i),u(i,r),f||(c=J(i,"click",n[4]),f=!0)},p(v,m){m&1&&!V(t.src,d="https://www.youtube.com/embed/"+v[0]+"?rel=0")&&a(t,"src",d)},d(v){v&&o(e),f=!1,c()}}}function U(n){let e,l=n[2]&&B(n);return{c(){l&&l.c(),e=T()},l(t){l&&l.l(t),e=T()},m(t,s){l&&l.m(t,s),y(t,e,s)},p(t,[s]){t[2]?l?l.p(t,s):(l=B(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:k,o:k,d(t){l&&l.d(t),t&&o(e)}}}function W(n,e,l){let{trailer_id:t}=e,s=!1;function d(){l(2,s=!0)}function h(){l(2,s=!1)}const i=()=>h();return n.$$set=r=>{"trailer_id"in r&&l(0,t=r.trailer_id)},[t,h,s,d,i]}class se extends M{constructor(e){super();N(this,e,W,U,$,{trailer_id:0,show:3,hide:1})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[1]}}function H(n,e,l){const t=n.slice();return t[1]=e[l],t}function K(n){let e,l,t,s,d,h=n[0],i=[];for(let r=0;r{"cast"in s&&l(0,t=s.cast)},[t]}class re extends M{constructor(e){super();N(this,e,ee,Z,$,{cast:0})}}export{re as C,se as M,le as S};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | ".svelte-kit/build/runtime/internal/start.js": {
3 | "file": "start-ae56e48a.js",
4 | "src": ".svelte-kit/build/runtime/internal/start.js",
5 | "isEntry": true,
6 | "imports": [
7 | "_vendor-fc6286ba.js",
8 | "_singletons-12a22614.js"
9 | ],
10 | "dynamicImports": [
11 | "src/routes/__layout.svelte",
12 | "src/routes/__error.svelte",
13 | "src/routes/index.svelte",
14 | "src/routes/NotFound.svelte",
15 | "src/routes/trending/[media].svelte",
16 | "src/routes/episode/[id]/[season_number]/[episode_number].svelte",
17 | "src/routes/seasons/[id]/[season_number].svelte",
18 | "src/routes/person/[id].svelte",
19 | "src/routes/search/[id].svelte",
20 | "src/routes/genre/[media]/[id].svelte",
21 | "src/routes/movie/[id].svelte",
22 | "src/routes/tv/[id].svelte"
23 | ],
24 | "css": [
25 | "assets/start-464e9d0a.css"
26 | ]
27 | },
28 | "src/routes/__layout.svelte": {
29 | "file": "pages/__layout.svelte-f4eb42df.js",
30 | "src": "src/routes/__layout.svelte",
31 | "isEntry": true,
32 | "isDynamicEntry": true,
33 | "imports": [
34 | "_vendor-fc6286ba.js",
35 | "_store-07881416.js",
36 | "_singletons-12a22614.js"
37 | ],
38 | "css": [
39 | "assets/pages/__layout.svelte-d7d8cb99.css"
40 | ]
41 | },
42 | "src/routes/__error.svelte": {
43 | "file": "pages/__error.svelte-1cf9c0b1.js",
44 | "src": "src/routes/__error.svelte",
45 | "isEntry": true,
46 | "isDynamicEntry": true,
47 | "imports": [
48 | "_vendor-fc6286ba.js"
49 | ],
50 | "css": [
51 | "assets/pages/__error.svelte-8a5069d9.css"
52 | ]
53 | },
54 | "src/routes/index.svelte": {
55 | "file": "pages/index.svelte-0b7a5c7b.js",
56 | "src": "src/routes/index.svelte",
57 | "isEntry": true,
58 | "isDynamicEntry": true,
59 | "imports": [
60 | "_vendor-fc6286ba.js",
61 | "_store-07881416.js",
62 | "_MainSection-8e495d87.js",
63 | "_ProgressBar-f61e37f1.js"
64 | ]
65 | },
66 | "src/routes/NotFound.svelte": {
67 | "file": "pages/NotFound.svelte-9659fd5f.js",
68 | "src": "src/routes/NotFound.svelte",
69 | "isEntry": true,
70 | "isDynamicEntry": true,
71 | "imports": [
72 | "_vendor-fc6286ba.js"
73 | ]
74 | },
75 | "src/routes/trending/[media].svelte": {
76 | "file": "pages/trending/[media].svelte-40e542c5.js",
77 | "src": "src/routes/trending/[media].svelte",
78 | "isEntry": true,
79 | "isDynamicEntry": true,
80 | "imports": [
81 | "_vendor-fc6286ba.js",
82 | "_store-07881416.js",
83 | "_MainSection-8e495d87.js",
84 | "_ProgressBar-f61e37f1.js"
85 | ]
86 | },
87 | "src/routes/episode/[id]/[season_number]/[episode_number].svelte": {
88 | "file": "pages/episode/[id]/[season_number]/[episode_number].svelte-a1e7498f.js",
89 | "src": "src/routes/episode/[id]/[season_number]/[episode_number].svelte",
90 | "isEntry": true,
91 | "isDynamicEntry": true,
92 | "imports": [
93 | "_vendor-fc6286ba.js"
94 | ]
95 | },
96 | "src/routes/seasons/[id]/[season_number].svelte": {
97 | "file": "pages/seasons/[id]/[season_number].svelte-7534c8b0.js",
98 | "src": "src/routes/seasons/[id]/[season_number].svelte",
99 | "isEntry": true,
100 | "isDynamicEntry": true,
101 | "imports": [
102 | "_vendor-fc6286ba.js",
103 | "_stores-462c50b9.js"
104 | ]
105 | },
106 | "src/routes/person/[id].svelte": {
107 | "file": "pages/person/[id].svelte-c20e0cad.js",
108 | "src": "src/routes/person/[id].svelte",
109 | "isEntry": true,
110 | "isDynamicEntry": true,
111 | "imports": [
112 | "_vendor-fc6286ba.js",
113 | "_store-07881416.js"
114 | ]
115 | },
116 | "src/routes/search/[id].svelte": {
117 | "file": "pages/search/[id].svelte-63c2cd3f.js",
118 | "src": "src/routes/search/[id].svelte",
119 | "isEntry": true,
120 | "isDynamicEntry": true,
121 | "imports": [
122 | "_vendor-fc6286ba.js",
123 | "_store-07881416.js",
124 | "_MainSection-8e495d87.js",
125 | "_ProgressBar-f61e37f1.js"
126 | ]
127 | },
128 | "src/routes/genre/[media]/[id].svelte": {
129 | "file": "pages/genre/[media]/[id].svelte-5293c531.js",
130 | "src": "src/routes/genre/[media]/[id].svelte",
131 | "isEntry": true,
132 | "isDynamicEntry": true,
133 | "imports": [
134 | "_vendor-fc6286ba.js",
135 | "_store-07881416.js",
136 | "_MainSection-8e495d87.js",
137 | "_ProgressBar-f61e37f1.js"
138 | ]
139 | },
140 | "src/routes/movie/[id].svelte": {
141 | "file": "pages/movie/[id].svelte-cb05cc7d.js",
142 | "src": "src/routes/movie/[id].svelte",
143 | "isEntry": true,
144 | "isDynamicEntry": true,
145 | "imports": [
146 | "_vendor-fc6286ba.js",
147 | "_store-07881416.js",
148 | "_ProgressBar-f61e37f1.js",
149 | "_Cast-6bfa9e9c.js"
150 | ]
151 | },
152 | "src/routes/tv/[id].svelte": {
153 | "file": "pages/tv/[id].svelte-6c7edfff.js",
154 | "src": "src/routes/tv/[id].svelte",
155 | "isEntry": true,
156 | "isDynamicEntry": true,
157 | "imports": [
158 | "_vendor-fc6286ba.js",
159 | "_store-07881416.js",
160 | "_ProgressBar-f61e37f1.js",
161 | "_Cast-6bfa9e9c.js",
162 | "_stores-462c50b9.js"
163 | ]
164 | },
165 | "_vendor-fc6286ba.js": {
166 | "file": "chunks/vendor-fc6286ba.js"
167 | },
168 | "_singletons-12a22614.js": {
169 | "file": "chunks/singletons-12a22614.js"
170 | },
171 | "_store-07881416.js": {
172 | "file": "chunks/store-07881416.js",
173 | "imports": [
174 | "_vendor-fc6286ba.js"
175 | ]
176 | },
177 | "_MainSection-8e495d87.js": {
178 | "file": "chunks/MainSection-8e495d87.js",
179 | "imports": [
180 | "_vendor-fc6286ba.js",
181 | "_store-07881416.js",
182 | "_ProgressBar-f61e37f1.js"
183 | ]
184 | },
185 | "_ProgressBar-f61e37f1.js": {
186 | "file": "chunks/ProgressBar-f61e37f1.js",
187 | "imports": [
188 | "_vendor-fc6286ba.js"
189 | ]
190 | },
191 | "_stores-462c50b9.js": {
192 | "file": "chunks/stores-462c50b9.js",
193 | "imports": [
194 | "_vendor-fc6286ba.js"
195 | ]
196 | },
197 | "_Cast-6bfa9e9c.js": {
198 | "file": "chunks/Cast-6bfa9e9c.js",
199 | "imports": [
200 | "_vendor-fc6286ba.js"
201 | ],
202 | "css": [
203 | "assets/Cast-cd25fbf7.css"
204 | ]
205 | }
206 | }
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[id]-de8563ca.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, s as subscribe, b as escape, a as add_attribute, e as each, v as validate_component } from "./app-14a936dc.js";
2 | import { a as media_type } from "./store-cc224516.js";
3 | import { P as ProgressBar } from "./ProgressBar-607c37c9.js";
4 | import { C as Cast, M as Modal, S as Spinner } from "./Cast-31f4e4f3.js";
5 | const IMAGE_API = "https://image.tmdb.org/t/p/";
6 | const MovieMedia = create_ssr_component(($$result, $$props, $$bindings, slots) => {
7 | let $media_type, $$unsubscribe_media_type;
8 | $$unsubscribe_media_type = subscribe(media_type, (value) => $media_type = value);
9 | let { movie_details } = $$props;
10 | let { trailer_id } = $$props;
11 | let { cast } = $$props;
12 | let modal;
13 | window.scrollTo({ top: -1e3, behavior: "smooth" });
14 | if ($$props.movie_details === void 0 && $$bindings.movie_details && movie_details !== void 0)
15 | $$bindings.movie_details(movie_details);
16 | if ($$props.trailer_id === void 0 && $$bindings.trailer_id && trailer_id !== void 0)
17 | $$bindings.trailer_id(trailer_id);
18 | if ($$props.cast === void 0 && $$bindings.cast && cast !== void 0)
19 | $$bindings.cast(cast);
20 | let $$settled;
21 | let $$rendered;
22 | do {
23 | $$settled = true;
24 | $$rendered = `${movie_details.id && trailer_id ? `
25 |
${escape(movie_details.title)}
26 | ${escape(movie_details.release_date ? movie_details.release_date.substring(0, 4) : "")}
27 |
${escape(movie_details.release_date ? movie_details.release_date : "No Date Available")}
28 | \u2022
29 |
${each(movie_details.genres, ({ id, name }, i) => `
${escape(name)}
30 | ${i !== movie_details.genres.length - 1 ? `
| ` : ``}`)}
31 | ${"runtime" in movie_details ? `
\u2022 ${escape((movie_details.runtime - movie_details.runtime % 60) / 60)}h ${escape(movie_details.runtime % 60)}m
32 |
` : ``}
33 |
${movie_details.vote_average ? `
${validate_component(ProgressBar, "ProgressBar").$$render($$result, { progress: movie_details.vote_average }, {}, {})}
` : ``}
34 | ${trailer_id !== 999 ? `
` : `
`}
36 |
${escape(movie_details.tagline)}
37 |
Overview
38 |
${escape(movie_details.overview)}
39 |
40 | ${validate_component(Cast, "Cast").$$render($$result, { cast }, {}, {})}
41 |
42 | ${trailer_id !== 999 ? `${validate_component(Modal, "Modal").$$render($$result, { trailer_id, this: modal }, {
43 | this: ($$value) => {
44 | modal = $$value;
45 | $$settled = false;
46 | }
47 | }, {})}` : ``}` : `${validate_component(Spinner, "Spinner").$$render($$result, {}, {}, {})}`}`;
48 | } while (!$$settled);
49 | $$unsubscribe_media_type();
50 | return $$rendered;
51 | });
52 | async function load({ fetch, page }) {
53 | media_type.set("movie");
54 | const res = await fetch("../api/getMovie", {
55 | headers: { "Content-Type": "application/json" },
56 | method: "POST",
57 | body: JSON.stringify({ media: "movie", id: page.params.id })
58 | });
59 | const datas = await res.json();
60 | const movie_details = await datas.res;
61 | const trailer = await fetch("../api/getTrailer", {
62 | headers: { "Content-Type": "application/json" },
63 | method: "POST",
64 | body: JSON.stringify({ media: "movie", id: page.params.id })
65 | });
66 | const trailer_details = await trailer.json();
67 | const trailer_id = await trailer_details.res.results.length ? trailer_details.res.results[0].key : 999;
68 | const resp = await fetch("../../api/getCast", {
69 | headers: { "Content-Type": "application/json" },
70 | method: "POST",
71 | body: JSON.stringify({ media: "movie", id: page.params.id })
72 | });
73 | const casts = await resp.json();
74 | const cast = await casts.res.cast;
75 | return {
76 | props: { movie_details, trailer_id, cast }
77 | };
78 | }
79 | const U5Bidu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
80 | let { movie_details } = $$props;
81 | let { trailer_id } = $$props;
82 | let { cast } = $$props;
83 | if ($$props.movie_details === void 0 && $$bindings.movie_details && movie_details !== void 0)
84 | $$bindings.movie_details(movie_details);
85 | if ($$props.trailer_id === void 0 && $$bindings.trailer_id && trailer_id !== void 0)
86 | $$bindings.trailer_id(trailer_id);
87 | if ($$props.cast === void 0 && $$bindings.cast && cast !== void 0)
88 | $$bindings.cast(cast);
89 | return `${validate_component(MovieMedia, "MovieMedia").$$render($$result, { movie_details, trailer_id, cast }, {}, {})}`;
90 | });
91 | export { U5Bidu5D as default, load };
92 |
--------------------------------------------------------------------------------
/src/global.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | type Media = {
6 | genres: [Genre];
7 | };
8 |
9 | type MediaPlatform = 'movie' | 'tv';
10 | type MediaType = 'movie' | 'tv' | 'person';
11 |
12 | type Genre = {
13 | id: number;
14 | name: string;
15 | };
16 |
17 | type Network = {
18 | display_priority: number;
19 | logo_path: string;
20 | provider_name: string;
21 | provider_id: number;
22 | }
23 |
24 | type Genres = {
25 | [Key in MediaPlatform]: Genre[];
26 | };
27 |
28 | type PersonType = {
29 | id: ?number;
30 | profile_path: ?string;
31 | character: ?string;
32 | name: ?string;
33 | known_for_department: ?string;
34 | gender: ?(1 | 2);
35 | birthday: ?string;
36 | place_of_birth: ?string;
37 | also_known_as: ?Array;
38 | biography: ?string;
39 | popularity: ?number;
40 | adult: ?boolean;
41 | imdb_id: ?string;
42 | homepage: ?(null | string);
43 | };
44 |
45 | type MovieType = {
46 | adult: ?boolean;
47 | backdrop_path: ?(string | null);
48 | belongs_to_collection: ?(null | Array);
49 | budget: ?number;
50 | genres: ?Array;
51 | homepage: ?(string | null);
52 | id: ?number;
53 | imdb_id: ?(string | null);
54 | original_language: ?string;
55 | original_title: ?string;
56 | overview: ?(string | null);
57 | popularity: ?number;
58 | poster_path: ?(string | null);
59 | production_companies: ?ProductionCompanies[];
60 | production_countries: ?ProductionCountries[];
61 | release_date: ?string;
62 | revenue: ?number;
63 | runtime: ?(number | null);
64 | spoken_languages: ?SpokenLanguages[];
65 | status: ?('Rumored' | 'Planned' | 'In Production' | 'Post Production' | 'Released' | 'Canceled');
66 | tagline: ?(string | null);
67 | title: ?string;
68 | video: ?boolean;
69 | vote_average: ?number;
70 | vote_count: ?number;
71 | };
72 |
73 | type TvType = {
74 | backdrop_path: ?(string | null);
75 | created_by: ?CreatedBy[];
76 | episode_run_time: ?Array;
77 | first_air_date: ?string;
78 | genres: ?Array;
79 | homepage: ?string;
80 | id: ?number;
81 | in_production: ?boolean;
82 | languages: ?Array;
83 | last_air_date: ?string;
84 | last_episode_to_air: ?LastAiredEpisode[];
85 | name: ?string;
86 | next_episode_to_air: ?null;
87 | networks: ?Networks[];
88 | origin_country: ?string;
89 | number_of_episodes: ?number;
90 | number_of_seasons: ?number;
91 | origin_country: ?Array;
92 | original_language: ?string;
93 | original_name: ?string;
94 | overview: ?string;
95 | popularity: ?number;
96 | poster_path: ?(string | null);
97 | production_companies: ?ProductionCompanies[];
98 | production_countries: ?ProductionCountries[];
99 | seasons: ?Seasons[];
100 | spoken_languages: ?SpokenLanguages[];
101 | status: ?string;
102 | tagline: ?string;
103 | type: ?string;
104 | vote_average: ?number;
105 | vote_count: ?number;
106 | };
107 |
108 | type Data = {
109 | cast: PersonType[];
110 | };
111 | type ProductionCompanies = {
112 | name: ?string;
113 | id: ?number;
114 | logo_path: ?(string | null);
115 | origin_country: ?string;
116 | };
117 |
118 | type ProductionCountries = {
119 | iso_3166_1: ?string;
120 | name: ?string;
121 | };
122 |
123 | type SpokenLanguages = {
124 | iso_639_1: ?string;
125 | name: ?string;
126 | };
127 | type CreatedBy = {
128 | id: ?number;
129 | credit_id: ?string;
130 | name: ?string;
131 | gender: ?number;
132 | profile_path: ?(string | null);
133 | };
134 |
135 | type LastAiredEpisode = {
136 | air_date: ?string;
137 | episode_number: ?number;
138 | id: ?number;
139 | name: ?string;
140 | overview: ?string;
141 | production_code: ?string;
142 | season_number: ?number;
143 | still_path: ?(string | null);
144 | vote_average: ?number;
145 | vote_count: ?number;
146 | };
147 |
148 | type Networks = {
149 | name: ?string;
150 | id: ?number;
151 | logo_path: ?(string | null);
152 | };
153 |
154 | type Seasons_type = {
155 | air_date: ?string;
156 | episode_count: ?number;
157 | id: ?number;
158 | name: ?string;
159 | overview: ?string;
160 | poster_path: ?string;
161 | season_number: ?number;
162 | };
163 |
164 | type Season_type = {
165 | _id: ?string;
166 | air_date: ?string;
167 | episodes: ?Episodes[];
168 | name: ?string;
169 | overview: ?string;
170 | id: ?number;
171 | poster_path: string | null;
172 | season_number: number;
173 | };
174 |
175 | type Episodes = {
176 | air_date: ?string;
177 | episode_number: ?number;
178 | crew: Crew[];
179 | guest_stars: Guest_stars[];
180 | id: ?number;
181 | name: ?string;
182 | overview: ?string;
183 | production_code: ?string;
184 | season_number: ?number;
185 | still_path: ?string;
186 | vote_average: ?number;
187 | vote_count: ?number;
188 | };
189 |
190 | type CrewType = {
191 | department: ?string;
192 | job: ?string;
193 | credit_id: ?string;
194 | adult: boolean | null;
195 | gender: 0 | 1;
196 | id: ?number;
197 | known_for_department: ?string;
198 | name: ?string;
199 | original_name: ?string;
200 | popularity: ?number;
201 | profile_path: string | null;
202 | };
203 |
204 | type GuestType = {
205 | credit_id: ?string;
206 | order: ?number;
207 | character: ?string;
208 | adult: boolean;
209 | gender: 0 | 1 | null;
210 | id: number;
211 | known_for_department: ?string;
212 | name: ?string;
213 | original_name: ?string;
214 | popularity: ?number;
215 | profile_path: ?(string | null);
216 | };
217 |
218 | type Trailer_type = {
219 | iso_639_1: string;
220 | iso_3166_1: string;
221 | name: string;
222 | key: string;
223 | site: string;
224 | size: number;
225 | type: string;
226 | official: boolean;
227 | published_at: string;
228 | id: string;
229 | }
230 |
231 | type CastType = {
232 | credit_id: string;
233 | original_name: string;
234 | id: number;
235 | genre_ids: Array;
236 | character: string;
237 | name: string;
238 | poster_path: string | null;
239 | vote_count: number;
240 | vote_average: number;
241 | popularity: number;
242 | episode_count: number;
243 | original_language: string;
244 | first_air_date: string;
245 | backdrop_path: string | null;
246 | overview: string;
247 | origin_country: Array;
248 | }
249 | type KnownForType = {
250 | credit_id: string;
251 | original_name: string;
252 | id: number;
253 | genre_ids: Array;
254 | character: string;
255 | name: string;
256 | poster_path: string | null;
257 | vote_count: number;
258 | vote_average: number;
259 | popularity: number;
260 | episode_count: number;
261 | original_language: string;
262 | first_air_date: string;
263 | backdrop_path: string | null;
264 | overview: string;
265 | origin_country: Array;
266 | }
267 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/[id]-8c40f23a.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, e as each, a as add_attribute, b as escape, v as validate_component, s as subscribe, f as set_store_value } from "./app-14a936dc.js";
2 | import { a as media_type } from "./store-cc224516.js";
3 | const IMAGE_API$1 = "https://image.tmdb.org/t/p/w300";
4 | function isMovie(x) {
5 | return x.media_type === "movie";
6 | }
7 | function isTv(x) {
8 | return x.media_type === "tv";
9 | }
10 | const KnownFor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
11 | let { knownFor } = $$props;
12 | let films = [];
13 | let tv = [];
14 | films = knownFor.filter(isMovie);
15 | tv = knownFor.filter(isTv);
16 | films.sort((a, b) => a.release_date > b.release_date ? -1 : 1);
17 | tv.sort((a, b) => a.first_air_date > b.first_air_date ? -1 : 1);
18 | if ($$props.knownFor === void 0 && $$bindings.knownFor && knownFor !== void 0)
19 | $$bindings.knownFor(knownFor);
20 | return `${films ? `Movies
21 |
22 | ${each(films, (movie) => `
`)}
` : ``}
27 | ${tv ? `TV
28 |
29 | ${each(tv, (show) => `
`)}
` : ``} `;
34 | });
35 | const IMAGE_API = "https://image.tmdb.org/t/p/w500/";
36 | const Person = create_ssr_component(($$result, $$props, $$bindings, slots) => {
37 | let { person } = $$props;
38 | let { knownFor } = $$props;
39 | if ($$props.person === void 0 && $$bindings.person && person !== void 0)
40 | $$bindings.person(person);
41 | if ($$props.knownFor === void 0 && $$bindings.knownFor && knownFor !== void 0)
42 | $$bindings.knownFor(knownFor);
43 | return `${person.profile_path ? `
` : `
`}
44 |
${escape(person.name)}
45 |
Personal Info
46 |
Known For
47 |
${escape(person.known_for_department)}
48 |
Gender
49 | ${person.gender === 2 ? `
Male
` : `
Female
`}
50 |
Birthdate
51 | ${person.birthday ? `
${escape(person.birthday)}
` : `
Unknown
`}
52 |
Place of Birth
53 | ${person.place_of_birth ? `
${escape(person.place_of_birth)}
` : `
Unknown
`}
54 | ${person.also_known_as && person.also_known_as.length ? `
Also Known As
55 | ${each(person.also_known_as, (alias) => `
${escape(alias)}
`)}` : ``}
56 |
57 |
${escape(person.name)}
58 |
Biography
59 |
${escape(person.biography)}
60 |
Known For
61 | ${validate_component(KnownFor, "KnownFor").$$render($$result, { knownFor }, {}, {})} `;
62 | });
63 | async function load({ fetch, page }) {
64 | const res = await fetch("../api/getMovie", {
65 | headers: { "Content-Type": "application/json" },
66 | method: "POST",
67 | body: JSON.stringify({ media: "person", id: page.params.id })
68 | });
69 | const datas = await res.json();
70 | const person = await datas.res;
71 | const resp = await fetch("../api/getKnownFor", {
72 | headers: { "Content-Type": "application/json" },
73 | method: "POST",
74 | body: JSON.stringify({ person: page.params.id })
75 | });
76 | const data = await resp.json();
77 | const knownFor = data.res.cast;
78 | return { props: { person, knownFor } };
79 | }
80 | const U5Bidu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
81 | let $media_type, $$unsubscribe_media_type;
82 | $$unsubscribe_media_type = subscribe(media_type, (value) => $media_type = value);
83 | set_store_value(media_type, $media_type = "person", $media_type);
84 | let { person } = $$props;
85 | let { knownFor } = $$props;
86 | if ($$props.person === void 0 && $$bindings.person && person !== void 0)
87 | $$bindings.person(person);
88 | if ($$props.knownFor === void 0 && $$bindings.knownFor && knownFor !== void 0)
89 | $$bindings.knownFor(knownFor);
90 | $$unsubscribe_media_type();
91 | return `${validate_component(Person, "Person").$$render($$result, { person, knownFor }, {}, {})}`;
92 | });
93 | export { U5Bidu5D as default, load };
94 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/pages/episode/[id]/[season_number]/[episode_number].svelte-a1e7498f.js:
--------------------------------------------------------------------------------
1 | import{S as fe,i as de,s as he,e as p,t as j,k as S,l as ce,c as m,a as b,g as $,d as c,n as N,b as u,O as K,f as G,D as a,h as y,K as _e,H as ue,j as ke,m as Ie,o as je,x as $e,u as De,v as Ve}from"../../../../chunks/vendor-fc6286ba.js";function pe(n,e,s){const t=n.slice();return t[1]=e[s],t}function me(n,e,s){const t=n.slice();return t[4]=e[s],t}function ve(n){let e,s,t,o,d,_,i,r,f,l,g,v=n[0].season_number+"",C,A,k=n[0].episode_number+"",w,D,E,P,x=n[0].name+"",M,Z,T,ee,z=n[0].air_date+"",R,te,F,le,se,q,L=n[0].overview+"",W,X,B,J,V=n[0].guest_stars.length&&ge(n),H=n[0].crew.length&&Ee(n);return{c(){e=p("h4"),s=j("Episode Information"),t=S(),o=p("div"),d=p("div"),_=p("img"),r=S(),f=p("div"),l=p("h4"),g=j("Season: "),C=j(v),A=j(" Episode: "),w=j(k),D=S(),E=p("h4"),P=j("Episode Name: "),M=j(x),Z=S(),T=p("h6"),ee=j("Air Date: "),R=j(z),te=S(),F=p("h6"),le=j("Overview:"),se=S(),q=p("h6"),W=j(L),X=S(),V&&V.c(),B=S(),H&&H.c(),J=ce(),this.h()},l(h){e=m(h,"H4",{class:!0});var I=b(e);s=$(I,"Episode Information"),I.forEach(c),t=N(h),o=m(h,"DIV",{class:!0});var Y=b(o);d=m(Y,"DIV",{class:!0});var re=b(d);_=m(re,"IMG",{class:!0,src:!0,alt:!0}),re.forEach(c),r=N(Y),f=m(Y,"DIV",{class:!0});var O=b(f);l=m(O,"H4",{});var Q=b(l);g=$(Q,"Season: "),C=$(Q,v),A=$(Q," Episode: "),w=$(Q,k),Q.forEach(c),D=N(O),E=m(O,"H4",{});var ae=b(E);P=$(ae,"Episode Name: "),M=$(ae,x),ae.forEach(c),Z=N(O),T=m(O,"H6",{});var ie=b(T);ee=$(ie,"Air Date: "),R=$(ie,z),ie.forEach(c),te=N(O),F=m(O,"H6",{});var oe=b(F);le=$(oe,"Overview:"),oe.forEach(c),se=N(O),q=m(O,"H6",{class:!0});var ne=b(q);W=$(ne,L),ne.forEach(c),O.forEach(c),Y.forEach(c),X=N(h),V&&V.l(h),B=N(h),H&&H.l(h),J=ce(),this.h()},h(){u(e,"class","pl-4"),u(_,"class","xl:h-44 items-start"),K(_.src,i=n[0].still_path?U+n[0].still_path:"/default.jpg")||u(_,"src",i),u(_,"alt","episode"),u(d,"class","flex flex-col xl:flex-row text-skin-base xl:rounded-lg"),u(q,"class","flex-1 pr-8 text-skin-muted mb-4"),u(f,"class","ml-2 block"),u(o,"class","bg-skin-primary flex flex-col xl:flex-row m-4 p-2 rounded-lg")},m(h,I){G(h,e,I),a(e,s),G(h,t,I),G(h,o,I),a(o,d),a(d,_),a(o,r),a(o,f),a(f,l),a(l,g),a(l,C),a(l,A),a(l,w),a(f,D),a(f,E),a(E,P),a(E,M),a(f,Z),a(f,T),a(T,ee),a(T,R),a(f,te),a(f,F),a(F,le),a(f,se),a(f,q),a(q,W),G(h,X,I),V&&V.m(h,I),G(h,B,I),H&&H.m(h,I),G(h,J,I)},p(h,I){I&1&&!K(_.src,i=h[0].still_path?U+h[0].still_path:"/default.jpg")&&u(_,"src",i),I&1&&v!==(v=h[0].season_number+"")&&y(C,v),I&1&&k!==(k=h[0].episode_number+"")&&y(w,k),I&1&&x!==(x=h[0].name+"")&&y(M,x),I&1&&z!==(z=h[0].air_date+"")&&y(R,z),I&1&&L!==(L=h[0].overview+"")&&y(W,L),h[0].guest_stars.length?V?V.p(h,I):(V=ge(h),V.c(),V.m(B.parentNode,B)):V&&(V.d(1),V=null),h[0].crew.length?H?H.p(h,I):(H=Ee(h),H.c(),H.m(J.parentNode,J)):H&&(H.d(1),H=null)},d(h){h&&c(e),h&&c(t),h&&c(o),h&&c(X),V&&V.d(h),h&&c(B),H&&H.d(h),h&&c(J)}}}function ge(n){let e,s,t,o,d,_=n[0].guest_stars,i=[];for(let r=0;r<_.length;r+=1)i[r]=be(me(n,_,r));return{c(){e=p("div"),s=p("h3"),t=j("Guest Stars"),o=S(),d=p("div");for(let r=0;r{"episode_details"in o&&s(0,t=o.episode_details)},[t]}class Ne extends fe{constructor(e){super();de(this,e,Se,He,he,{episode_details:0})}}function Ce(n){let e,s;return e=new Ne({props:{episode_details:n[0]}}),{c(){ke(e.$$.fragment)},l(t){Ie(e.$$.fragment,t)},m(t,o){je(e,t,o),s=!0},p(t,[o]){const d={};o&1&&(d.episode_details=t[0]),e.$set(d)},i(t){s||($e(e.$$.fragment,t),s=!0)},o(t){De(e.$$.fragment,t),s=!1},d(t){Ve(e,t)}}}async function Oe({fetch:n,page:e}){return{props:{episode_details:await(await(await n("../../../api/getEpisode",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:e.params.id,season_number:e.params.season_number,episode_number:e.params.episode_number})})).json()).res}}}function Ae(n,e,s){let{episode_details:t}=e;return n.$$set=o=>{"episode_details"in o&&s(0,t=o.episode_details)},[t]}class Pe extends fe{constructor(e){super();de(this,e,Ae,Ce,he,{episode_details:0})}}export{Pe as default,Oe as load};
2 |
--------------------------------------------------------------------------------