@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | //Make sure last_checked is always updated on successful run. |
| 76 | 76 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
| 77 | 77 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
| 78 | - ->where('id', $row->id) |
|
| 79 | - ->update('tracker_titles'); |
|
| 78 | + ->where('id', $row->id) |
|
| 79 | + ->update('tracker_titles'); |
|
| 80 | 80 | |
| 81 | 81 | print " - ({$titleData['latest_chapter']})\n"; |
| 82 | 82 | } else { |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function updateCustom() { |
| 98 | 98 | $query = $this->db->select('*') |
| 99 | - ->from('tracker_sites') |
|
| 100 | - ->where('status', 'enabled') |
|
| 101 | - ->get(); |
|
| 99 | + ->from('tracker_sites') |
|
| 100 | + ->where('status', 'enabled') |
|
| 101 | + ->get(); |
|
| 102 | 102 | |
| 103 | 103 | $sites = $query->result_array(); |
| 104 | 104 | foreach ($sites as $site) { |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | //Make sure last_checked is always updated on successful run. |
| 114 | 114 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
| 115 | 115 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
| 116 | - ->where('id', $titleID) |
|
| 117 | - ->update('tracker_titles'); |
|
| 116 | + ->where('id', $titleID) |
|
| 117 | + ->update('tracker_titles'); |
|
| 118 | 118 | |
| 119 | 119 | print " - ({$titleData['latest_chapter']})\n"; |
| 120 | 120 | } else { |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
| 172 | 172 | if($titleData['title'] !== $row->title) { |
| 173 | 173 | $this->db->set('title', $titleData['title']) |
| 174 | - ->where('id', $row->id) |
|
| 175 | - ->update('tracker_titles'); |
|
| 174 | + ->where('id', $row->id) |
|
| 175 | + ->update('tracker_titles'); |
|
| 176 | 176 | //TODO: Add to history somehow? |
| 177 | 177 | print " - NEW TITLE ({$titleData['title']})\n"; |
| 178 | 178 | } else { |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | //We might as well try to update as well. |
| 183 | 183 | if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) { |
| 184 | 184 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
| 185 | - ->where('id', $row->id) |
|
| 186 | - ->update('tracker_titles'); |
|
| 185 | + ->where('id', $row->id) |
|
| 186 | + ->update('tracker_titles'); |
|
| 187 | 187 | } |
| 188 | 188 | } else { |
| 189 | 189 | log_message('error', "{$row->title} failed to update title successfully"); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | class Tracker_Admin_Model extends Tracker_Base_Model { |
| 4 | 4 | public function __construct() { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | // @formatter:on |
| 66 | 66 | |
| 67 | 67 | if($query->num_rows() > 0) { |
| 68 | - foreach ($query->result() as $row) { |
|
| 68 | + foreach($query->result() as $row) { |
|
| 69 | 69 | print "> {$row->title} <{$row->site_class}> | <{$row->id}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 70 | 70 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
| 71 | 71 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | ->get(); |
| 102 | 102 | |
| 103 | 103 | $sites = $query->result_array(); |
| 104 | - foreach ($sites as $site) { |
|
| 104 | + foreach($sites as $site) { |
|
| 105 | 105 | if($titleDataList = $this->sites->{$site['site_class']}->doCustomUpdate()) { |
| 106 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
| 106 | + foreach($titleDataList as $titleURL => $titleData) { |
|
| 107 | 107 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 108 | 108 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
| 109 | 109 | if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) { |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | // @formatter:on |
| 166 | 166 | |
| 167 | 167 | if($query->num_rows() > 0) { |
| 168 | - foreach ($query->result() as $row) { |
|
| 168 | + foreach($query->result() as $row) { |
|
| 169 | 169 | print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 170 | 170 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
| 171 | 171 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |