Update to new format

This commit is contained in:
Lncvrt committed 2026-04-19 16:27:05 -07:00
1 parent 4a12643098
commit b0dfab3b6a
2 files changed
+4 -5

No files matched your search

+1 -1
View File
@@ -1018,7 +1018,7 @@ app.get('/launcher/update', launcherUpdateHandler, {
},
query: t.Object({
target: t.String(),
arch: t.String(),
arch: t.Optional(t.String()),
currentVersion: t.String()
}),
headers: t.Object({
+3 -4
View File
@@ -9,7 +9,7 @@ export const handler = async (context: Context) => {
const { connection, db } = dbResult
const target = context.query.target
const arch = context.query.arch
const arch = context.query.arch ?? undefined
// const currentVersion = context.query.currentVersion
const versionsData = await db
@@ -27,13 +27,12 @@ export const handler = async (context: Context) => {
if (versionsData.length != 1) return
const downloadData = JSON.parse(versionsData[0].downloadData)[
(target.split('-')[0] == 'linux' ? target + '-' + arch : target)
(target.split('-')[0] == 'linux' && arch ? target + '-' + arch : target)
.replace('windows', 'win')
.replace('darwin', 'macos')
.replace('x86_64', 'x64')
.replace('i686', 'x86')
.replace('aarch64', 'arm64')
.replace('armv7', 'arm32')
.replace('fedora', 'redhat')
]
if (!downloadData) return