fix: Made store downloads extract in their own folder

feat: Implemented cemu integration
This commit is contained in:
Simeon Radivoev 2026-04-05 12:46:50 +03:00
parent 09b8b9c6f8
commit 764691fc86
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
11 changed files with 156 additions and 52 deletions

View file

@ -70,7 +70,8 @@ export class InstallJob implements IJob<never, InstallJobStates>
name: game.title,
summary: game.description,
system_slug: gameId.system,
extract_path: path.join('roms', gameId.system),
path_fs: path.join('roms', gameId.system, game.title),
extract_path: path.join('roms', gameId.system, game.title),
};
break;
@ -218,7 +219,7 @@ export class InstallJob implements IJob<never, InstallJobStates>
source_id: info.source_id,
source: this.source,
slug: info.slug,
path_fs: info.path_fs,
path_fs: info.path_fs ?? (info.extract_path ? path.join(downloadPath, info.extract_path) : undefined),
last_played: info.last_played,
platform_id: platformId,
igdb_id: info.igdb_id,

View file

@ -1,10 +1,11 @@
import z from "zod";
import { IJob, JobContext } from "../task-queue";
import { ActiveGameSchema, ActiveGameType } from "@/bun/types/typesc.schema";
import { db, events, plugins } from "../app";
import { config, db, events, plugins } from "../app";
import * as appSchema from "@schema/app";
import { eq, sql } from "drizzle-orm";
import { spawn } from 'node:child_process';
import path from "node:path";
export class LaunchGameJob implements IJob<z.infer<typeof LaunchGameJob.dataSchema>, "playing">
{
@ -60,7 +61,9 @@ export class LaunchGameJob implements IJob<z.infer<typeof LaunchGameJob.dataSche
const spawnGame = spawn(this.validCommand.command, {
shell: true,
cwd: this.validCommand.startDir,
signal: context.abortSignal
signal: context.abortSignal,
env: {
}
});
spawnGame.stdout.on('data', data => console.log(data));
@ -82,6 +85,8 @@ export class LaunchGameJob implements IJob<z.infer<typeof LaunchGameJob.dataSche
const bunGame = Bun.spawn([this.validCommand.metadata.emulatorBin, ...commandArgs], {
cwd: this.validCommand.startDir,
signal: context.abortSignal,
env: {
}
});
context.abortSignal.addEventListener('abort', reject);