@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | //Make sure last_checked is always updated on successful run. |
153 | 153 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
154 | 154 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
155 | - ->where('id', $row->title_id) |
|
156 | - ->update('tracker_titles'); |
|
155 | + ->where('id', $row->title_id) |
|
156 | + ->update('tracker_titles'); |
|
157 | 157 | |
158 | 158 | print " - ({$titleData['latest_chapter']})\n"; |
159 | 159 | } else { |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | //Make sure last_checked is always updated on successful run. |
168 | 168 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
169 | 169 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
170 | - ->where('id', $row->title_id) |
|
171 | - ->update('tracker_titles'); |
|
170 | + ->where('id', $row->title_id) |
|
171 | + ->update('tracker_titles'); |
|
172 | 172 | |
173 | 173 | print " - (No chapters found?)\n"; |
174 | 174 | } else { |
@@ -191,10 +191,10 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function updateCustom() { |
193 | 193 | $query = $this->db->select('*') |
194 | - ->from('tracker_sites') |
|
195 | - ->where('status', 'enabled') |
|
196 | - ->where('tracker_sites.use_custom', 'Y') |
|
197 | - ->get(); |
|
194 | + ->from('tracker_sites') |
|
195 | + ->where('status', 'enabled') |
|
196 | + ->where('tracker_sites.use_custom', 'Y') |
|
197 | + ->get(); |
|
198 | 198 | |
199 | 199 | $sites = $query->result_array(); |
200 | 200 | foreach ($sites as $site) { |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | //Make sure last_checked is always updated on successful run. |
212 | 212 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
213 | 213 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
214 | - ->where('id', $titleID) |
|
215 | - ->update('tracker_titles'); |
|
214 | + ->where('id', $titleID) |
|
215 | + ->update('tracker_titles'); |
|
216 | 216 | |
217 | 217 | print " - ({$titleData['latest_chapter']})\n"; |
218 | 218 | } else { |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | |
242 | 242 | public function refollowCustom() { |
243 | 243 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
244 | - ->from('tracker_titles') |
|
245 | - ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
|
246 | - ->where('tracker_titles.followed','N') |
|
247 | - ->where('tracker_titles !=', '255') |
|
248 | - ->where('tracker_sites.status', 'enabled') |
|
249 | - ->where('tracker_sites.use_custom', 'Y') |
|
250 | - ->get(); |
|
244 | + ->from('tracker_titles') |
|
245 | + ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
|
246 | + ->where('tracker_titles.followed','N') |
|
247 | + ->where('tracker_titles !=', '255') |
|
248 | + ->where('tracker_sites.status', 'enabled') |
|
249 | + ->where('tracker_sites.use_custom', 'Y') |
|
250 | + ->get(); |
|
251 | 251 | |
252 | 252 | if($query->num_rows() > 0) { |
253 | 253 | foreach($query->result() as $row) { |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | |
259 | 259 | if(!empty($titleData)) { |
260 | 260 | $this->db->set($titleData) |
261 | - ->where('id', $row->id) |
|
262 | - ->update('tracker_titles'); |
|
261 | + ->where('id', $row->id) |
|
262 | + ->update('tracker_titles'); |
|
263 | 263 | |
264 | 264 | print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n"; |
265 | 265 | } else { |
@@ -307,8 +307,8 @@ discard block |
||
307 | 307 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
308 | 308 | if($titleData['title'] !== $row->title) { |
309 | 309 | $this->db->set('title', $titleData['title']) |
310 | - ->where('id', $row->id) |
|
311 | - ->update('tracker_titles'); |
|
310 | + ->where('id', $row->id) |
|
311 | + ->update('tracker_titles'); |
|
312 | 312 | //TODO: Add to history somehow? |
313 | 313 | print " - NEW TITLE ({$titleData['title']})\n"; |
314 | 314 | } else { |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | //We might as well try to update as well. |
319 | 319 | if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) { |
320 | 320 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
321 | - ->where('id', $row->id) |
|
322 | - ->update('tracker_titles'); |
|
321 | + ->where('id', $row->id) |
|
322 | + ->update('tracker_titles'); |
|
323 | 323 | } |
324 | 324 | } else { |
325 | 325 | log_message('error', "{$row->title} failed to update title successfully"); |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | $date = $temp_now->format('Y-m-d'); |
336 | 336 | |
337 | 337 | $query = $this->db->select('1') |
338 | - ->from('site_stats') |
|
339 | - ->where('date', $date) |
|
340 | - ->get(); |
|
338 | + ->from('site_stats') |
|
339 | + ->where('date', $date) |
|
340 | + ->get(); |
|
341 | 341 | |
342 | 342 | if($query->num_rows() > 0) { |
343 | 343 | $this->db->set('total_requests', 'total_requests+1', FALSE) |
344 | - ->where('date', $date) |
|
345 | - ->update('site_stats'); |
|
344 | + ->where('date', $date) |
|
345 | + ->update('site_stats'); |
|
346 | 346 | } else { |
347 | 347 | $this->db->insert('site_stats', [ |
348 | 348 | 'date' => $date, |