@@ -115,34 +115,34 @@ |
||
| 115 | 115 | |
| 116 | 116 | ////We need the series to be tracked |
| 117 | 117 | $idCQuery = $this->db->select('id') |
| 118 | - ->where('user_id', $userID) |
|
| 119 | - ->where('title_id', $titleID) |
|
| 120 | - ->get('tracker_chapters'); |
|
| 118 | + ->where('user_id', $userID) |
|
| 119 | + ->where('title_id', $titleID) |
|
| 120 | + ->get('tracker_chapters'); |
|
| 121 | 121 | if(!($idCQuery->num_rows() > 0)) { |
| 122 | 122 | //NOTE: This pretty much repeats a lot of what we already did above. Is there a better way to do this? |
| 123 | 123 | $this->Tracker->list->update($userID, $site, $title, $chapter, FALSE); |
| 124 | 124 | |
| 125 | 125 | $idCQuery = $this->db->select('id') |
| 126 | - ->where('user_id', $userID) |
|
| 127 | - ->where('title_id', $titleID) |
|
| 128 | - ->get('tracker_chapters'); |
|
| 126 | + ->where('user_id', $userID) |
|
| 127 | + ->where('title_id', $titleID) |
|
| 128 | + ->get('tracker_chapters'); |
|
| 129 | 129 | } |
| 130 | 130 | if($idCQuery->num_rows() > 0) { |
| 131 | 131 | $idCQueryRow = $idCQuery->row(); |
| 132 | 132 | |
| 133 | 133 | //Check if it is already favourited |
| 134 | 134 | $idFQuery = $this->db->select('id') |
| 135 | - ->where('chapter_id', $idCQueryRow->id) |
|
| 136 | - ->where('chapter', $chapter) |
|
| 137 | - ->where('page', $page) |
|
| 138 | - ->get('tracker_favourites'); |
|
| 135 | + ->where('chapter_id', $idCQueryRow->id) |
|
| 136 | + ->where('chapter', $chapter) |
|
| 137 | + ->where('page', $page) |
|
| 138 | + ->get('tracker_favourites'); |
|
| 139 | 139 | if($idFQuery->num_rows() > 0) { |
| 140 | 140 | //Chapter is already favourited, so remove it from DB |
| 141 | 141 | if($removeIfExists) { |
| 142 | 142 | $idFQueryRow = $idFQuery->row(); |
| 143 | 143 | |
| 144 | 144 | $isSuccess = (bool) $this->db->where('id', $idFQueryRow->id) |
| 145 | - ->delete('tracker_favourites'); |
|
| 145 | + ->delete('tracker_favourites'); |
|
| 146 | 146 | |
| 147 | 147 | if($isSuccess) { |
| 148 | 148 | $success = array( |