Files
romm/backend/endpoints/responses/search.py
zurdi 1afa59d9de feat: offer Steam as a cover art provider
The cover search dialog only reached SteamGridDB, so a PC game whose
capsule lives on Steam had no way to pick it up short of a full
re-match. Steam now joins SteamGridDB behind `GET /search/cover`,
ordered by the configured cover priority, and each result carries its
provider so the dialog can filter by source and credit the artwork.

The Steam handler builds the picker from the store search alone and
probes the CDN for the portrait capsule and the landscape header under
the same budget the match picker uses, so a slow CDN costs thumbnails
rather than the dialog. Hits with no artwork are dropped.

A failing provider costs only its own covers; a rejected SteamGridDB
key is still reported, since that is the user's to fix. The "search
cover" action in the edit dialog now opens whenever either provider is
enabled, and the game overview credits Steam-hosted covers.

The resource shape the picker consumes moves to the shared base handler
as `CoverResource` / `CoverResult`, since it is no longer SteamGridDB's
alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Untv32z88QMZ2yRSsTgGcC
2026-09-14 00:35:08 +02:00

42 lines
1.0 KiB
Python

from typing import Literal
from handler.metadata.base_handler import CoverResource
from .base import BaseModel
CoverProvider = Literal["sgdb", "steam"]
class SearchRomSchema(BaseModel):
id: int | None = None
igdb_id: int | None = None
moby_id: int | None = None
ss_id: int | None = None
sgdb_id: int | None = None
flashpoint_id: str | None = None
launchbox_id: int | None = None
demozoo_id: int | None = None
steam_id: int | None = None
libretro_id: str | None = None
platform_id: int
name: str
slug: str = ""
summary: str = ""
igdb_url_cover: str = ""
moby_url_cover: str = ""
ss_url_cover: str = ""
sgdb_url_cover: str = ""
flashpoint_url_cover: str = ""
launchbox_url_cover: str = ""
demozoo_url_cover: str = ""
steam_url_cover: str = ""
libretro_url_cover: str = ""
is_unidentified: bool
is_identified: bool
class SearchCoverSchema(BaseModel):
provider: CoverProvider
name: str
resources: list[CoverResource]