refactor: Removed unused vars and imports
This commit is contained in:
parent
05fafced07
commit
02a4f2c9a9
27 changed files with 39 additions and 44 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import Elysia, { status } from "elysia";
|
||||
import { config, events, jar, plugins, taskQueue } from "./app";
|
||||
import { config, events, plugins, taskQueue } from "./app";
|
||||
import z from "zod";
|
||||
import { getCurrentUserApiUsersMeGet, tokenApiTokenPost, UserSchema } from "@clients/romm";
|
||||
import secrets from '../api/secrets';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { RPC_URL, } from "@shared/constants";
|
||||
import { config, customEmulators, db, emulatorsDb, plugins, taskQueue } from "../../app";
|
||||
import { config, db, emulatorsDb, plugins, taskQueue } from "../../app";
|
||||
import { findExecs, getValidLaunchCommands } from "./launchGameService";
|
||||
import * as emulatorSchema from '@schema/emulators';
|
||||
import { and, eq } from "drizzle-orm";
|
||||
import { getErrorMessage, hashFile } from "@/bun/utils";
|
||||
import { getErrorMessage } from "@/bun/utils";
|
||||
import { checkFiles, getLocalGameMatch } from "./utils";
|
||||
import fs from 'node:fs/promises';
|
||||
import { getStoreGameFromId } from "../../store/services/gamesService";
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ import { config, db, emulatorsDb, plugins } from "../../app";
|
|||
import { and, eq } from "drizzle-orm";
|
||||
import * as schema from "@schema/app";
|
||||
import { StoreGameType } from "@shared/constants";
|
||||
import { DetailedRomSchema, getCurrentUserApiUsersMeGet, getRomApiRomsIdGet, SimpleRomSchema } from "@clients/romm";
|
||||
import * as emulatorSchema from "@schema/emulators";
|
||||
import { extractStoreGameSourceId, getStoreGame } from "../../store/services/gamesService";
|
||||
import { hashFile, isSteamDeck, isSteamDeckGameMode } from "@/bun/utils";
|
||||
import { hashFile } from "@/bun/utils";
|
||||
|
||||
export async function calculateSize (installPath: string | null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { EmulatorDownloadInfoType, EmulatorPackageType } from "@/shared/constants";
|
||||
import { AsyncSeriesBailHook, AsyncSeriesHook } from "tapable";
|
||||
import { any } from "zod";
|
||||
|
||||
interface EmulatorPostInstallContext
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import z from "zod";
|
||||
import { IJob, JobContext } from "../task-queue";
|
||||
import { ActiveGameSchema, ActiveGameType } from "@/bun/types/typesc.schema";
|
||||
import { config, db, events, plugins } from "../app";
|
||||
import { db, events, plugins } from "../app";
|
||||
import * as appSchema from "@schema/app";
|
||||
import { eq, sql } from "drizzle-orm";
|
||||
import { eq } 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">
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import { config, db } from "@/bun/api/app";
|
||||
import { config } from "@/bun/api/app";
|
||||
import { PluginContextType, PluginType } from "@/bun/types/typesc.schema";
|
||||
import path from 'node:path';
|
||||
import desc from './package.json';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import { config, db } from "@/bun/api/app";
|
||||
import { config } from "@/bun/api/app";
|
||||
import { PluginContextType, PluginType } from "@/bun/types/typesc.schema";
|
||||
import configFile from './PCSX2.ini' with { type: 'file' };
|
||||
import Mustache from 'mustache';
|
||||
|
|
@ -59,7 +59,7 @@ export default class PCSX2Integration implements PluginType
|
|||
"4k": 6,
|
||||
};
|
||||
|
||||
const view = {
|
||||
const paths = {
|
||||
BIOS_PATH: biosFolder,
|
||||
SNAPSHOTS_PATH: path.join(storageFolder, 'snaps'),
|
||||
SAVE_STATES_PATH: path.join(savesFolder, 'states'),
|
||||
|
|
@ -68,13 +68,17 @@ export default class PCSX2Integration implements PluginType
|
|||
COVERS_PATH: path.join(storageFolder, 'covers'),
|
||||
TEXTURES_PATH: path.join(storageFolder, 'textures'),
|
||||
RECURSIVE_PATHS: path.join(config.get('downloadPath'), 'roms', 'PS2'),
|
||||
};
|
||||
|
||||
await Promise.all(Object.values(paths).map(p => ensureDir(p)));
|
||||
|
||||
const view = {
|
||||
...paths,
|
||||
ENABLE_WIDESCREEN: config.get('emulatorWidescreen'),
|
||||
ASPECT_RATIO: config.get('emulatorWidescreen') ? "16:9" : "Auto 4:3/3:2",
|
||||
UPSCALE_MULTIPLIER: resolutionMapping[config.get('emulatorResolution')] ?? 1
|
||||
};
|
||||
|
||||
await Promise.all(Object.values(view).map(p => ensureDir(p)));
|
||||
|
||||
let pscx2Path = '';
|
||||
if (process.platform === 'win32')
|
||||
pscx2Path = path.join(ctx.autoValidCommand.metadata.emulatorDir, 'inis');
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import { PluginContextType, PluginType } from "@/bun/types/typesc.schema";
|
||||
import desc from './package.json';
|
||||
import { GameflowHooks } from "@/bun/api/hooks/app";
|
||||
import { config } from "@/bun/api/app";
|
||||
import path from "node:path";
|
||||
import { ensureDir } from "fs-extra";
|
||||
import toml, { TomlTable } from 'smol-toml';
|
||||
import fs from 'node:fs/promises';
|
||||
import bin from './eeprom.bin' with { type: 'file' };
|
||||
|
|
|
|||
|
|
@ -138,8 +138,11 @@ export default class RommIntegration implements PluginType
|
|||
});
|
||||
games.push(...rommGames.data.items.map(g =>
|
||||
{
|
||||
const game: FrontEndGameType & { igdb_id?: number; } = this.convertRomToFrontend(g);
|
||||
game.igdb_id = g.igdb_id ?? undefined;
|
||||
const game: FrontEndGameTypeWithIds = {
|
||||
...this.convertRomToFrontend(g),
|
||||
igdb_id: g.igdb_id,
|
||||
ra_id: g.ra_id
|
||||
};
|
||||
return game;
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import path, { dirname } from "node:path";
|
|||
import { DirSchema, SystemInfoSchema } from "@/shared/constants";
|
||||
import { getDevices, getDevicesCurated } from "./drives";
|
||||
import getFolderSize from "get-folder-size";
|
||||
import si, { battery } from 'systeminformation';
|
||||
import si from 'systeminformation';
|
||||
import { getStoreFolder } from "./store/services/gamesService";
|
||||
|
||||
export const system = new Elysia({ prefix: '/api/system' })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue