Ejemplo n.º 1
0
 /**
  * @param array $parameters
  *
  * @return bool|int
  */
 public function insertRelease(array $parameters = [])
 {
     if ($parameters['regexid'] == "") {
         $parameters['regexid'] = " null ";
     }
     if ($parameters['reqid'] != "") {
         $parameters['reqid'] = $this->pdo->escapeString($parameters['reqid']);
     } else {
         $parameters['reqid'] = " null ";
     }
     $parameters['id'] = $this->pdo->queryInsert(sprintf("INSERT INTO releases (name, searchname, totalpart, groupid, adddate, guid, categoryid, regexid, rageid, postdate, fromname, size, reqid, passwordstatus, completion, haspreview, nfostatus, nzbstatus,\n\t\t\t\t\tisrenamed, iscategorized, reqidstatus, prehashid)\n                    VALUES (%s, %s, %d, %d, now(), %s, %d, %s, -1, %s, %s, 0, %s, %d, 100,-1, -1, %d, %d, 1, %d, %d)", $parameters['name'], $parameters['searchname'], $parameters['totalpart'], $parameters['groupid'], $parameters['guid'], $parameters['categoryid'], $parameters['regexid'], $parameters['postdate'], $parameters['fromname'], $parameters['reqid'], $parameters['passwordstatus'], $parameters['nzbstatus'], $parameters['isrenamed'], $parameters['reqidstatus'], $parameters['prehashid']));
     $this->sphinxSearch->insertRelease($parameters);
     return $parameters['id'];
 }
Ejemplo n.º 2
0
 /**
  * Insert a single release returning the ID on success or false on failure.
  *
  * @param array $parameters Insert parameters, must be escaped if string.
  *
  * @return bool|int
  */
 public function insertRelease(array $parameters = [])
 {
     $parameters['id'] = $this->pdo->queryInsert(sprintf("INSERT INTO releases\n\t\t\t\t\t(name, searchname, totalpart, group_id, adddate, guid, rageid, postdate, fromname,\n\t\t\t\t\tsize, passwordstatus, haspreview, categoryid, nfostatus, nzbstatus,\n\t\t\t\t\tisrenamed, iscategorized, reqidstatus, preid)\n\t\t\t\t VALUES (%s, %s, %d, %d, NOW(), %s, -1, %s, %s, %s, %d, -1, %d, -1, %d, %d, 1, %d, %d)", $parameters['name'], $parameters['searchname'], $parameters['totalpart'], $parameters['group_id'], $parameters['guid'], $parameters['postdate'], $parameters['fromname'], $parameters['size'], $this->passwordStatus, $parameters['categoryid'], $parameters['nzbstatus'], $parameters['isrenamed'], $parameters['reqidstatus'], $parameters['preid']));
     $this->sphinxSearch->insertRelease($parameters);
     return $parameters['id'];
 }