Completed
Push — master ( 40cff3...c302c1 )
by Angus
02:30
created
application/models/Tracker/Sites/JaiminisBox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 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 JaiminisBox extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://jaiminisbox.com/reader';
5 5
 
6 6
 	//NOTE: Jaimini's Box appears to have disabled API support for some reason. Fallback to using the old method.
7
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
7
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
8 8
 		$fullURL = $this->getFullTitleURL($title_url);
9 9
 		$titleData = [];
10 10
 		if($content = $this->get_content($fullURL, "", "", FALSE, TRUE, ['adult' => 'true'])) {
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 						//Make sure last_checked is always updated on successful run.
75 75
 						//CHECK: Is there a reason we aren't just doing this in updateByID?
76 76
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
77
-						         ->where('id', $row->title_id)
78
-						         ->update('tracker_titles');
77
+								 ->where('id', $row->title_id)
78
+								 ->update('tracker_titles');
79 79
 
80 80
 						print " - ({$titleData['latest_chapter']})\n";
81 81
 					} else {
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function updateCustom() {
101 101
 		$query = $this->db->select('*')
102
-		                  ->from('tracker_sites')
103
-		                  ->where('status', 'enabled')
104
-		                  ->where('tracker_sites.use_custom', 'Y')
105
-		                  ->get();
102
+						  ->from('tracker_sites')
103
+						  ->where('status', 'enabled')
104
+						  ->where('tracker_sites.use_custom', 'Y')
105
+						  ->get();
106 106
 
107 107
 		$sites = $query->result_array();
108 108
 		foreach ($sites as $site) {
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 									//Make sure last_checked is always updated on successful run.
118 118
 									//CHECK: Is there a reason we aren't just doing this in updateByID?
119 119
 									$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
120
-									         ->where('id', $titleID)
121
-									         ->update('tracker_titles');
120
+											 ->where('id', $titleID)
121
+											 ->update('tracker_titles');
122 122
 
123 123
 									print " - ({$titleData['latest_chapter']})\n";
124 124
 								} else {
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 
143 143
 	public function refollowCustom() {
144 144
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
145
-		                  ->from('tracker_titles')
146
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
147
-		                  ->where('tracker_titles.followed','N')
148
-		                  ->where('tracker_titles !=', '255')
149
-		                  ->where('tracker_sites.status', 'enabled')
150
-		                  ->where('tracker_sites.use_custom', 'Y')
151
-		                  ->get();
145
+						  ->from('tracker_titles')
146
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
147
+						  ->where('tracker_titles.followed','N')
148
+						  ->where('tracker_titles !=', '255')
149
+						  ->where('tracker_sites.status', 'enabled')
150
+						  ->where('tracker_sites.use_custom', 'Y')
151
+						  ->get();
152 152
 
153 153
 		if($query->num_rows() > 0) {
154 154
 			foreach($query->result() as $row) {
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 
160 160
 					if(!empty($titleData)) {
161 161
 						$this->db->set($titleData)
162
-						         ->where('id', $row->id)
163
-						         ->update('tracker_titles');
162
+								 ->where('id', $row->id)
163
+								 ->update('tracker_titles');
164 164
 
165 165
 						print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n";
166 166
 					} else {
@@ -208,8 +208,8 @@  discard block
 block discarded – undo
208 208
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
209 209
 					if($titleData['title'] !== $row->title) {
210 210
 						$this->db->set('title', $titleData['title'])
211
-						         ->where('id', $row->id)
212
-						         ->update('tracker_titles');
211
+								 ->where('id', $row->id)
212
+								 ->update('tracker_titles');
213 213
 						//TODO: Add to history somehow?
214 214
 						print " - NEW TITLE ({$titleData['title']})\n";
215 215
 					} else {
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 					//We might as well try to update as well.
220 220
 					if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) {
221 221
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
222
-						         ->where('id', $row->id)
223
-						         ->update('tracker_titles');
222
+								 ->where('id', $row->id)
223
+								 ->update('tracker_titles');
224 224
 					}
225 225
 				} else {
226 226
 					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() {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		// @formatter:on
65 65
 
66 66
 		if($query->num_rows() > 0) {
67
-			foreach ($query->result() as $row) {
67
+			foreach($query->result() as $row) {
68 68
 				print "> {$row->title} <{$row->site_class}> | <{$row->title_id}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
69 69
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
70 70
 				if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 		                  ->get();
106 106
 
107 107
 		$sites = $query->result_array();
108
-		foreach ($sites as $site) {
108
+		foreach($sites as $site) {
109 109
 			if($titleDataList = $this->sites->{$site['site_class']}->doCustomUpdate()) {
110
-				foreach ($titleDataList as $titleURL => $titleData) {
110
+				foreach($titleDataList as $titleURL => $titleData) {
111 111
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
112 112
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
113 113
 						if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
145 145
 		                  ->from('tracker_titles')
146 146
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
147
-		                  ->where('tracker_titles.followed','N')
147
+		                  ->where('tracker_titles.followed', 'N')
148 148
 		                  ->where('tracker_titles !=', '255')
149 149
 		                  ->where('tracker_sites.status', 'enabled')
150 150
 		                  ->where('tracker_sites.use_custom', 'Y')
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		// @formatter:on
203 203
 
204 204
 		if($query->num_rows() > 0) {
205
-			foreach ($query->result() as $row) {
205
+			foreach($query->result() as $row) {
206 206
 				print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
207 207
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
208 208
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
Please login to merge, or discard this patch.