GithubHelp home page GithubHelp logo

Comments (2)

jrichardsz avatar jrichardsz commented on May 19, 2024

Reviewing and with some intuition

image

I found the values:

MOVIES_API = api.themoviedb.org/3
MOVIES_KEY = 81*****e0b

MOVIES_KEY is the TMDB API KEY

Whit these values, there are some successes and errors in the log:

Generating data for Movies...
GET: /foo/bar/like-netflix/movies/kate 597891.mkv
url: https://api.themoviedb.org/3/movie/597891?api_key=81****0b&append_to_response=images,credits,similar
GET: /foo/bar/like-netflix/movies/shang-chi-and-the-legend-of-the-ten-rings 566525.mkv
url: https://api.themoviedb.org/3/movie/566525?api_key=81****0b&append_to_response=images,credits,similar
GET: /foo/bar/like-netflix/movies/shang-chi-and-the-legend-of-the-ten-rings 566525.mkv
url: https://api.themoviedb.org/3/movie/566525?api_key=81****0b&append_to_response=images,credits,similar
GET: /foo/bar/like-netflix/movies/shang-chi-and-the-legend-of-the-ten-rings 566525.mkv
url: https://api.themoviedb.org/3/movie/566525?api_key=81****0b&append_to_response=images,credits,similar
GET: /foo/bar/like-netflix/movies/shang-chi-and-the-legend-of-the-ten-rings 566525.mkv
url: https://api.themoviedb.org/3/movie/566525?api_key=81****0b&append_to_response=images,credits,similar
There was a problem adding this movie PrismaClientUnknownRequestError: 
Invalid `prisma.movie.upsert()` invocation:

  Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })
    at cb (/tmp/workspace/homehost/server/node_modules/@prisma/client/runtime/index.js:36956:17)
    at async upsertManyMovies (/tmp/workspace/homehost/server/jobs/index.js:114:7)
    at async sync (/tmp/workspace/homehost/server/jobs/index.js:55:27) {
  clientVersion: '3.1.1'
}

And when I try to load the web, there is nothing to see :(

image

This is the log when web page try to query something:

(node:24817) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at format (/tmp/workspace/homehost/server/utils/index.js:15:21)
    at getRandomMovie (/tmp/workspace/homehost/server/data/index.js:348:10)
    at async getRandomMovieOrTVShow (/tmp/workspace/homehost/server/data/index.js:336:31)
    at async /tmp/workspace/homehost/server/routes/index.js:232:25
(Use `node --trace-warnings ...` to show where the warning was created)

What I'm doing wrong?

from homehost.

jrichardsz avatar jrichardsz commented on May 19, 2024

I was able to run everything:

image

But when I try to watch a video, I got this error:

image

I will create another issue with this new error.

Steps to startup

  • create an api key in tmdb service: https://stackoverflow.com/a/31047912/3957754
  • choose some movies in the tmdb web and store its movie-id
  • in your local disk, create a folder and put 3 videos (mkv/mp4). Rename them setting the movie-id + space + whatever. Example : 1402 another movie.mkv
  • As in this test, probably you cannot a spotify account or videos for tv, we are using only movies. If this is your case, modify this line in the client to render just movies:
    • if (containerRef.current && containerRef.current.firstChild && data) {
  • npm install in server and client folder
  • open 3 shells and export these variables. Note the use of the local ip in CLIENT_BASE_URL variables:
export REACT_APP_IMAGE_BASE="https://image.tmdb.org/t/p/"
export REACT_APP_TMDB_BASE="https://www.imdb.com/title/"
export TMDB_KEY='811****ce0b'
export SPOTIFY_CLIENT_ID='<client_id>'
export SPOTIFY_CLIENT_SECRET='<client_secret>'
export MOVIES_PATH='/foo/bar/storage/movies'
export TV_PATH='/opt/tv/directory'
export MUSIC_PATH='/opt/music/directory'
export DATABASE_URL='file:./data/media.db'
export CLIENT_BASE_URL='http://192.168.A.B:3000'
export MOVIES_API=api.themoviedb.org/3
export MOVIES_KEY=811****ce0b
  • create the database running npx prisma migrate dev in the server folder, using one of the previous opened shells
  • startup the prisma server running npx prisma studio in the server, using one of the previous opened shells
  • startup the home-host server running npm run dev, using one of the previous opened shells
  • startup the home-host web client running npm run start, using one of the previous opened shells
  • an url will be opened in your default browser. Change the localhost in the url by your local ip

Coming soon

  • I will perform a PR with Docker docker-compose alternative
  • Create an issue related to video load error
  • Create an issue to enable or disable categories: movies, tvs, songs. In this version, if you cannot pass all of categories (videos/songa on your local disk), an error is throwed. That why a react modification is required in the previous steps

from homehost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.