|
247 | 247 | </script> |
248 | 248 | <script> |
249 | 249 | async function fetchChangelog(repo, elementId, downloadButtonId) { |
250 | | - const url = `https://api.github.com/repos/SpotCompiled/${repo}/releases/latest`; |
| 250 | + const ghUrl = `https://api.github.com/repos/SpotCompiled/${repo}/releases/latest`; |
| 251 | + let sourceUrl = `https://raw.githubusercontent.com/SpotCompiled/SpotC-Repo/refs/heads/main/Scarlet%20Repo.json`; |
251 | 252 | try { |
252 | | - const response = await fetch(url); |
253 | | - const data = await response.json(); |
| 253 | + const ghResponse = await fetch(ghUrl); |
| 254 | + const ghData = await ghResponse.json(); |
254 | 255 | const changelogElement = document.getElementById(elementId); |
255 | 256 |
|
| 257 | + if (repo === 'SpotilifeC') { |
| 258 | + sourceUrl = `https://raw.githubusercontent.com/SpotCompiled/SpotC-Repo/refs/heads/main/AltStore%20Repo.json`; |
| 259 | + } |
| 260 | + |
| 261 | + const sourceResponse = await fetch(sourceUrl); |
| 262 | + const sourceData = await sourceResponse.json(); |
| 263 | + |
| 264 | + let app = ""; |
| 265 | + if (repo === 'SpotC-Plus-Plus') { |
| 266 | + app = sourceData.apps.find(app => app.name === 'SpotC++'); |
| 267 | + } else if (repo === 'SpotveeC') { |
| 268 | + app = sourceData.apps.find(app => app.name === 'SpotveeC'); |
| 269 | + } else if (repo === 'SpotilifeC') { |
| 270 | + app = sourceData.apps.find(app => app.name === 'SpotilifeC'); |
| 271 | + } |
| 272 | + |
256 | 273 | // Extract latest version |
257 | | - const latestVersion = data.tag_name; |
| 274 | + const latestVersion = ghData.tag_name; |
258 | 275 |
|
259 | 276 | // Extract download URL for IPA file |
260 | | - const downloadUrl = data.assets.find(asset => asset.name.endsWith('.ipa') && !asset.name.includes('ALTSTORE')).browser_download_url; |
| 277 | + const downloadUrl = app.downloadURL; |
261 | 278 |
|
262 | 279 | // Remove everything after "***" |
263 | | - const endIndex = data.body.indexOf('***'); |
| 280 | + const endIndex = ghData.body.indexOf('***'); |
264 | 281 | if (endIndex !== -1) { |
265 | | - cleanChangelog = data.body.substring(0, endIndex); |
| 282 | + cleanChangelog = ghData.body.substring(0, endIndex); |
266 | 283 | } |
267 | 284 |
|
268 | 285 | // Split the changelog text by newline |
|
0 commit comments