feat: add image validation and SteamGridDB fallback to game stub creation

This commit is contained in:
2026-04-29 11:36:38 +08:00
parent caae92ca4f
commit a4cf2636e7
2 changed files with 16 additions and 3 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ export function isSyncStale(lastSync: Date | null): boolean {
return Date.now() - new Date(lastSync).getTime() > SEVEN_DAYS_MS
}
async function validateImageUrl(url: string): Promise<boolean> {
export async function validateImageUrl(url: string): Promise<boolean> {
try {
const res = await fetch(url, { method: "HEAD", signal: AbortSignal.timeout(5000) });
return res.ok;
@@ -39,7 +39,7 @@ async function validateImageUrl(url: string): Promise<boolean> {
}
}
async function fetchSteamGridDBCover(gameTitle: string): Promise<string | null> {
export async function fetchSteamGridDBCover(gameTitle: string): Promise<string | null> {
try {
const apiKey = process.env.STEAMGRIDDB_API_KEY;
if (!apiKey) return null;