From 642aebad9871114f27b22c86762dec2a68607228 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 2 Nov 2025 22:03:23 -0700 Subject: [PATCH] Add sha256sums to update data --- database.sql | 5 +++-- src/lib/tables.ts | 3 ++- src/routes/launcher/loader/update-data.ts | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/database.sql b/database.sql index ec493f7..4496714 100644 --- a/database.sql +++ b/database.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: localhost --- Generation Time: Nov 02, 2025 at 03:39 AM +-- Generation Time: Nov 03, 2025 at 05:02 AM -- Server version: 12.0.2-MariaDB -- PHP Version: 8.4.14 @@ -48,7 +48,8 @@ CREATE TABLE `launcherupdates` ( `downloadUrls` text NOT NULL, `platforms` text NOT NULL, `hidden` tinyint(1) NOT NULL DEFAULT 1, - `place` int(11) NOT NULL DEFAULT 0 + `place` int(11) NOT NULL DEFAULT 0, + `sha256sums` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED; -- -------------------------------------------------------- diff --git a/src/lib/tables.ts b/src/lib/tables.ts index 226e37f..6d8e02b 100644 --- a/src/lib/tables.ts +++ b/src/lib/tables.ts @@ -28,5 +28,6 @@ export const launcherUpdates = mysqlTable('launcherupdates', { platforms: text('platforms').notNull(), executables: text('executables').notNull(), hidden: boolean('hidden').notNull().default(true), - place: int('place').notNull().default(0) + place: int('place').notNull().default(0), + sha256sums: text('sha256sums').notNull() }) diff --git a/src/routes/launcher/loader/update-data.ts b/src/routes/launcher/loader/update-data.ts index 045cd91..ba2ab17 100644 --- a/src/routes/launcher/loader/update-data.ts +++ b/src/routes/launcher/loader/update-data.ts @@ -8,7 +8,8 @@ export async function handler(db: MySql2Database) { id: launcherUpdates.id, releaseDate: launcherUpdates.releaseDate, downloadUrls: launcherUpdates.downloadUrls, - platforms: launcherUpdates.platforms + platforms: launcherUpdates.platforms, + sha256sums: launcherUpdates.sha256sums }) .from(launcherUpdates) .where(eq(launcherUpdates.hidden, false)) @@ -19,7 +20,8 @@ export async function handler(db: MySql2Database) { const versions = versionsRaw.map(v => ({ ...v, downloadUrls: JSON.parse(v.downloadUrls), - platforms: JSON.parse(v.platforms) + platforms: JSON.parse(v.platforms), + sha256sums: JSON.parse(v.sha256sums) })) return jsonResponse(versions[0])