mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
Show a "where you left off" screenshot on the Home continue-playing rail and the live-activity board, with a small cover-art thumbnail (PIP) in the corner so the game stays identifiable. Both render at the image's natural aspect. Backend: - New shared util `continue_playing_screenshot(rom, latest_save)` resolving the image in priority order: latest save's screenshot, then title screen, then first gameplay screenshot (None → frontend falls back to cover art). - `SimpleRomSchema.screenshot_path` populated only on the `last_played` query; `get_latest_saves_for_roms` batch handler (+ tests). - ActivityEntry / ActivityEntrySchema gain `screenshot_path`, computed from the session player's latest save in both the socket and REST heartbeat paths. Frontend: - New shared `CoverArtPip.vue` (bottom-right 2D cover thumbnail), reused by GameCard and ActivityCard. - Home continue-playing rail uses `screenshot_path` + PIP, natural aspect (no forced hero/style). - Activity board: screenshot-forward cover + PIP, and a wrapping flex layout so cards share a uniform height with natural-ratio widths (gallery-card behavior). - GameCover only keys the measured ratio by rom id for the rom's own cover, so a `coverSrc` override (screenshot) never pollutes the gallery's ratio cache. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
415 B
Python
23 lines
415 B
Python
from .base import BaseModel
|
|
|
|
|
|
class ActivityEntrySchema(BaseModel):
|
|
user_id: int
|
|
username: str
|
|
avatar_path: str
|
|
rom_id: int
|
|
rom_name: str
|
|
rom_cover_path: str = ""
|
|
screenshot_path: str = ""
|
|
platform_slug: str
|
|
platform_name: str
|
|
device_id: str
|
|
device_type: str
|
|
started_at: str
|
|
|
|
|
|
class ActivityClearSchema(BaseModel):
|
|
user_id: int
|
|
device_id: str
|
|
rom_id: int
|