fix(api): appInfoDetails checks ok through assertOk

The require-assert-ok lint rule failed CI on main: the function tested
res.ok by hand. A refusal now throws inside the existing try and still
yields null (no details), so behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
phantomptrandClaude Opus 5.5 committed 2026-09-28 22:13:06 -07:00
1 parent 5a28819d25
commit 1934dc8e9d
1 file changed
+4 -2
+4 -2
View File
@@ -4939,8 +4939,9 @@ export async function appInfoDetails(
titleId: string,
): Promise<AppInfoDetails | null> {
try {
const res = await invoke<{
const resp = await invoke<{
ok?: boolean;
error?: string | null;
rows?: Array<{ key?: string; val?: string }>;
}>("ps5_appinfo_query", {
addr: toMgmtAddr(transferAddr),
@@ -4948,7 +4949,8 @@ export async function appInfoDetails(
titleId,
keys: "CONTENT_VERSION,APP_VER,#_size,#_install_time,#_last_access_time,CONTENT_ID",
});
if (!res?.ok) return null;
// A refusal throws here and lands in the catch below: no details.
const res = assertOk(resp, "Read game details");
const v = new Map((res.rows ?? []).map((r) => [r.key ?? "", (r.val ?? "").trim()]));
const get = (k: string) => v.get(k) || null;
const size = Number(get("#_size"));