@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | if($query->num_rows() > 0) { |
80 | 80 | $hardRateLimit = 500; //This is to avoid any possible IP bans by cache breaking again. |
81 | 81 | $siteRateLimits = []; |
82 | - foreach ($query->result() as $row) { |
|
83 | - if(!array_key_exists($row->site_class,$siteRateLimits)) { |
|
82 | + foreach($query->result() as $row) { |
|
83 | + if(!array_key_exists($row->site_class, $siteRateLimits)) { |
|
84 | 84 | $siteRateLimits[$row->site_class] = 0; |
85 | 85 | } |
86 | 86 | $siteRateLimits[$row->site_class]++; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $query = $query->get(); |
143 | 143 | |
144 | 144 | if($query->num_rows() > 0) { |
145 | - foreach ($query->result() as $row) { |
|
145 | + foreach($query->result() as $row) { |
|
146 | 146 | $this->handleUpdate($row); |
147 | 147 | } |
148 | 148 | } |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | ->get(); |
221 | 221 | |
222 | 222 | $sites = $query->result_array(); |
223 | - foreach ($sites as $site) { |
|
223 | + foreach($sites as $site) { |
|
224 | 224 | $siteClass = $this->sites->{$site['site_class']}; |
225 | 225 | if($titleDataList = $siteClass->doCustomUpdate()) { |
226 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
226 | + foreach($titleDataList as $titleURL => $titleData) { |
|
227 | 227 | $titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that. |
228 | 228 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
229 | 229 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
267 | 267 | ->from('tracker_titles') |
268 | 268 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
269 | - ->where('tracker_titles.followed','N') |
|
269 | + ->where('tracker_titles.followed', 'N') |
|
270 | 270 | ->where('tracker_titles !=', '255') |
271 | 271 | ->where('tracker_sites.status', 'enabled') |
272 | 272 | ->where('tracker_sites.use_custom', 'Y') |
@@ -84,7 +84,9 @@ discard block |
||
84 | 84 | $siteRateLimits[$row->site_class] = 0; |
85 | 85 | } |
86 | 86 | $siteRateLimits[$row->site_class]++; |
87 | - if($siteRateLimits[$row->site_class] > $hardRateLimit) continue; |
|
87 | + if($siteRateLimits[$row->site_class] > $hardRateLimit) { |
|
88 | + continue; |
|
89 | + } |
|
88 | 90 | |
89 | 91 | $this->handleUpdate($row); |
90 | 92 | } |
@@ -192,8 +194,7 @@ discard block |
||
192 | 194 | print " - Something went wrong?\n"; |
193 | 195 | } |
194 | 196 | } |
195 | - } |
|
196 | - else { |
|
197 | + } else { |
|
197 | 198 | //TODO: We should have some way to handle this in the site models. |
198 | 199 | if($row->site_class !== 'MangaKakarot') { |
199 | 200 | log_message('error', "{$row->site_class} | {$row->title} ({$row->title_url}) | Failed to update."); |