feat: Implemented emulator installation
feat: Updated romm API version feat: Updated es-de rules feat: Added tabs to game details refactor: returned to global query definitions to help with typescript performance
This commit is contained in:
parent
cf6fff6fac
commit
3750e9ed8f
103 changed files with 4888 additions and 1632 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { eq } from "drizzle-orm";
|
||||
import { cache } from "./app";
|
||||
import cacheSchema from "@schema/cache";
|
||||
import { GithubReleaseSchema } from "@/shared/constants";
|
||||
|
||||
export const CACHE_KEYS = {
|
||||
ROM_PLATFORMS: 'rom-platforms',
|
||||
|
|
@ -31,4 +32,14 @@ export async function getOrCached<T> (key: string, getter: () => Promise<T>, opt
|
|||
.run();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getOrCachedGithubRelease (path: string)
|
||||
{
|
||||
return getOrCached(`github-release-${path}`, async () =>
|
||||
{
|
||||
const response = await fetch(`https://api.github.com/repos/${path}/releases/latest`, { method: "GET" });
|
||||
if (!response.ok) throw new Error(response.statusText);
|
||||
return GithubReleaseSchema.parseAsync(await response.json());
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue