fix: logins now refresh on plugins load

feat: Added tar archive support
fix: Downloaded games and emulator execute permission now updated
fix: Fixed rclone for linux
fix: on screen keyaboard only now shows up when using a gamepad or touch
This commit is contained in:
Simeon Radivoev 2026-04-21 23:21:50 +03:00
parent 6aacec2c0d
commit 7bd0ebdcca
Signed by: simeonradivoev
GPG key ID: C16C2132A7660C8E
39 changed files with 523 additions and 275 deletions

View file

@ -4,7 +4,7 @@ import os from 'node:os';
import path from "node:path";
import * as appSchema from '@schema/app';
import * as emulatorSchema from '@schema/emulators';
import { db, emulatorsDb, plugins } from "@/bun/api/app";
import { config, db, emulatorsDb, plugins } from "@/bun/api/app";
import { and, eq } from "drizzle-orm";
import { getOrCached } from "@/bun/api/cache";
import { Glob } from "bun";
@ -318,4 +318,47 @@ export async function getExistingStoreEmulatorDownload (emulator: EmulatorPackag
// this should only happen if download info is missing maybe manually deleted or wasn't saved.
return undefined;
}
export async function buildLaunchCommand (ctx: { gamePath: string; systemSlug: string; mainGlob?: string | null; }): Promise<CommandEntry | undefined>
{
if (ctx.systemSlug !== 'win' && ctx.systemSlug !== 'linux' && ctx.systemSlug !== 'mac') return;
const downloadPath = config.get('downloadPath');
const gamePathAbsolute = path.join(downloadPath, ctx.gamePath);
if (!(await fs.exists(gamePathAbsolute))) return;
const gamePathStat = await fs.stat(gamePathAbsolute);
if (gamePathStat.isDirectory())
{
let mainGlob = ctx.mainGlob;
if (!mainGlob && ctx.systemSlug === 'win') mainGlob = '**/*.exe';
if (!mainGlob) return;
const fileGlob = new Glob(mainGlob);
for await (const file of fileGlob.scan({ cwd: path.join(downloadPath, ctx.gamePath) }))
{
return {
startDir: path.join(downloadPath, ctx.gamePath, path.dirname(file)),
command: [`./${path.basename(file)}`],
id: `store-${process.platform}`,
shell: false,
valid: true,
metadata: {
romPath: path.join(downloadPath, ctx.gamePath, file)
}
};
}
} else
{
return {
startDir: path.join(downloadPath, path.dirname(ctx.gamePath)),
command: [`./${path.basename(ctx.gamePath)}`],
id: `store-${process.platform}`,
valid: true,
shell: false,
metadata: {
romPath: path.join(downloadPath, ctx.gamePath),
}
};
}
}