code: function updateLastSeen(params, config, conn) {
  
    // validate
    if (!params.uri && !params.cacheURI) {
      return 'You must enter a valid uri'
    }
  
    var reviewer = params.reviewer || 'http://melvincarvalho.com/#me'
  
    // defaults
    config = config || require('../config/config.js')
  
    // main
    return new Promise((resolve, reject) => {
  
      if (!conn) {
        var conn = wc_db.getConnection(config.db)
      }
  
      getUserId({ "uri": reviewer}).then(function(ret){
        params.reviewer_id = ret.ret
        return params.reviewer_id
      }).then(function(reviewer_id){
        var sql
        if (params.uri) {
          sql = 'UPDATE Media set lastSeen = NOW() where uri = :uri'
        } else if (params.cacheURI) {
          sql = 'UPDATE Media set lastSeen = NOW() where cacheURI = :cacheURI'
        }
        debug('updateLastSeen', sql, params)
  
        return conn.query(sql, { replacements: { "uri" : params.uri, "cacheURI" : params.cacheURI } })
      }).then(function(ret) {
  
        var rating = {}
        rating.uri = params.uri
        rating.cacheURI = params.cacheURI
        rating.reviewer = params.reviewer_id
        debug(rating)
        return insertRating(rating, config, conn)
      }).then(function(ret) {
        return resolve({"ret" : ret, "conn" : conn})
      }).catch(function(err) {
        return reject({"err" : err, "conn" : conn})
      })
  
    })
  
  }
docs: Updates rating in the database
  @param {Object} rating  The rating to add.
  @param {Object} config  The optional config.
  @param {Object} conn    The optional db connection.
  @return {Object} Promise with success or fail.