sendRequest(identifier, type, ip, user_agent, user) {
    return Promise.resolve()
      .then(() => tmdb.lookup(identifier, type))
      .then(movie => {
        const username = user === undefined ? undefined : user.username;
        // Add request to database
        return this.database.run(this.queries.insertRequest, [
          movie.id,
          movie.title,
          movie.year,
          movie.poster_path,
          movie.background_path,
          username,
          ip,
          user_agent,
          movie.type
        ]);
      });
  }
/**
   * Send request for given media id.
   * @param {identifier, type} the id of the media object and type of media must be defined
   * @returns {Promise} If nothing has gone wrong.
   */
Send request for given media id.
@param {identifier, type} the id of the media object and type of media must be defined
@returns {Promise} If nothing has gone wrong.
Send request for given media id . @param { identifier type } the id of the media object and type of media must be defined @returns { Promise } If nothing has gone wrong .
sendRequest(identifier, type, ip, user_agent, user) {
    return Promise.resolve()
      .then(() => tmdb.lookup(identifier, type))
      .then(movie => {
        const username = user === undefined ? undefined : user.username;
        return this.database.run(this.queries.insertRequest, [
          movie.id,
          movie.title,
          movie.year,
          movie.poster_path,
          movie.background_path,
          username,
          ip,
          user_agent,
          movie.type
        ]);
      });
  }
sendRequest ( identifier , type , ip , user_agent , user ) { return Promise . resolve ( ) . then ( ( ) => tmdb . lookup ( identifier , type ) ) . then ( movie => { const username = user === undefined ? undefined : user . username ; return this . database . run ( this . queries . insertRequest , [ movie . id , movie . title , movie . year , movie . poster_path , movie . background_path , username , ip , user_agent , movie . type ] ) ; } ) ; }
Send request for given media id.
Send request for given media id .
// Add request to database