Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function do_insert_process($mpx_id, $account, $set_priority, $add_anyways) {
- $this->total++;
- //var_dump($medias);
- if (!$this->dba->ckMediaExists($mpx_id)) {
- $medias = $this->getMPXInfoFromMPXId($mpx_id, $account);
- if ($medias['response']['entryCount'] == 0) {
- $this->not_found_mpx++;
- $res['msg'] = "media id: ".$mpx_id." no ha sido encontrada en MPX!";
- if ($add_anyways == 1) {
- $this->ingresados++;
- $this->dba->insertEmptyTitle($mpx_id, $account, $set_priority);
- $res['msg'] .= " Se agregó a la DB! ";
- }
- return $res;
- }
- var_dump($medias['response']['entries'][0]);
- $mpx = $this->mpx_data($medias['response']['entries'][0]);
- $mpx['account'] = $account;
- if ($set_priority == 1){
- $lastID = $this->dba->insertTitleNewly($mpx);
- } else {
- $lastID = $this->dba->insertTitle($mpx);
- }
- if ($lastID){
- $res['msg'] = 'OK';
- unset($medias['response']['entries'][0]['content']);
- $res['entry'] = $medias['response']['entries'][0];
- }
- } else {
- $res['msg'] = "media id: ".$mpx_id." ya existe en la base de datos!";
- $this->repetidos++;
- if ($set_priority == 1) {
- $this->dba->setPriority('mpx_id', $mpx_id, 1);
- $res['msg'] .= ' Se marcó como prioridad';
- }
- }
- return $res;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement