Completed
Push — master ( febe31...ca2a85 )
by Angus
02:52
created
application/models/Tracker/Tracker_Admin_Model.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 {
@@ -138,13 +138,13 @@  discard block
 block discarded – undo
138 138
 
139 139
 	public function refollowCustom() {
140 140
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
141
-		                  ->from('tracker_titles')
142
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
143
-		                  ->where('tracker_titles.followed','N')
144
-		                  ->where('tracker_titles !=', '255')
145
-		                  ->where('tracker_sites.status', 'enabled')
146
-		                  ->where('tracker_sites.use_custom', 'Y')
147
-		                  ->get();
141
+						  ->from('tracker_titles')
142
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
143
+						  ->where('tracker_titles.followed','N')
144
+						  ->where('tracker_titles !=', '255')
145
+						  ->where('tracker_sites.status', 'enabled')
146
+						  ->where('tracker_sites.use_custom', 'Y')
147
+						  ->get();
148 148
 
149 149
 		if($query->num_rows() > 0) {
150 150
 			foreach($query->result() as $row) {
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 
156 156
 					if(!empty($titleData)) {
157 157
 						$this->db->set($titleData)
158
-						         ->where('id', $row->id)
159
-						         ->update('tracker_titles');
158
+								 ->where('id', $row->id)
159
+								 ->update('tracker_titles');
160 160
 
161 161
 						print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n";
162 162
 					} else {
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
205 205
 					if($titleData['title'] !== $row->title) {
206 206
 						$this->db->set('title', $titleData['title'])
207
-						         ->where('id', $row->id)
208
-						         ->update('tracker_titles');
207
+								 ->where('id', $row->id)
208
+								 ->update('tracker_titles');
209 209
 						//TODO: Add to history somehow?
210 210
 						print " - NEW TITLE ({$titleData['title']})\n";
211 211
 					} else {
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 					//We might as well try to update as well.
216 216
 					if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) {
217 217
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
218
-						         ->where('id', $row->id)
219
-						         ->update('tracker_titles');
218
+								 ->where('id', $row->id)
219
+								 ->update('tracker_titles');
220 220
 					}
221 221
 				} else {
222 222
 					log_message('error', "{$row->title} failed to update title successfully");
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
141 141
 		                  ->from('tracker_titles')
142 142
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
143
-		                  ->where('tracker_titles.followed','N')
143
+		                  ->where('tracker_titles.followed', 'N')
144 144
 		                  ->where('tracker_titles !=', '255')
145 145
 		                  ->where('tracker_sites.status', 'enabled')
146 146
 		                  ->where('tracker_sites.use_custom', 'Y')
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		// @formatter:on
199 199
 
200 200
 		if($query->num_rows() > 0) {
201
-			foreach ($query->result() as $row) {
201
+			foreach($query->result() as $row) {
202 202
 				print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
203 203
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
204 204
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
Please login to merge, or discard this patch.
application/models/Tracker/Sites/WebToons.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
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 WebToons extends Base_Site_Model {
4 4
 	/* Webtoons.com has a very weird and pointless URL format.
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 				$titleData['title'] = trim((string) $xml->{'channel'}->title);
52 52
 
53 53
 				$chapterURLSegments = explode('/', ((string) $xml->{'channel'}->item[0]->link));
54
-				$titleData['latest_chapter'] = preg_replace('/^.*?([0-9]+)$/', '$1', $chapterURLSegments[7]) . ':--:' . $chapterURLSegments[6];
55
-				$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) $xml->{'channel'}->item[0]->pubDate));
54
+				$titleData['latest_chapter'] = preg_replace('/^.*?([0-9]+)$/', '$1', $chapterURLSegments[7]).':--:'.$chapterURLSegments[6];
55
+				$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $xml->{'channel'}->item[0]->pubDate));
56 56
 
57 57
 				if($firstGet) {
58 58
 					$titleData = array_merge($titleData, $this->doCustomFollow($content['body'], ['id' => $title_parts[0]]));
Please login to merge, or discard this patch.