(page)
| 144 | let current = 0; |
| 145 | |
| 146 | function ajaxHandle(page) { |
| 147 | if (utils.urlPart(page.url, 3) !== 'info') return; |
| 148 | const detailPart = utils.urlPart(page.url, 5); |
| 149 | con.info('page', detailPart); |
| 150 | if (detailPart === 'list') { |
| 151 | utils.waitUntilTrue( |
| 152 | function () { |
| 153 | return j.$('#contentList').length; |
| 154 | }, |
| 155 | function () { |
| 156 | if (j.$('#simple-navi a[href*="manga"]').length) { |
| 157 | Proxer.type = 'manga'; |
| 158 | } else { |
| 159 | Proxer.type = 'anime'; |
| 160 | } |
| 161 | |
| 162 | const tempCurrent: number = parseInt(Proxer.overview!.getIdentifier(page.url)); |
| 163 | if (tempCurrent !== current) { |
| 164 | current = tempCurrent; |
| 165 | page.handlePage(); |
| 166 | } else { |
| 167 | try { |
| 168 | page.handleList(); |
| 169 | } catch (e) { |
| 170 | con.error(e); |
| 171 | page.handlePage(); |
| 172 | } |
| 173 | } |
| 174 | }, |
| 175 | ); |
| 176 | } |
| 177 | if (detailPart === 'details' || !detailPart) { |
| 178 | utils.waitUntilTrue( |
| 179 | function () { |
| 180 | return j.$('.hreview-aggregate').length; |
| 181 | }, |
| 182 | function () { |
| 183 | current = parseInt(Proxer.overview!.getIdentifier(page.url)); |
| 184 | if (j.$('#simple-navi a[href*="manga"]').length) { |
| 185 | Proxer.type = 'manga'; |
| 186 | } else { |
| 187 | Proxer.type = 'anime'; |
| 188 | } |
| 189 | page.handlePage(); |
| 190 | }, |
| 191 | ); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | function getEpisodeFallback(string, fallback) { |
| 196 | const exclude = string.match(/(special|extra)/gi); |
no test coverage detected