wip: planning-slot test

This commit is contained in:
2026-10-16 05:20:52 +02:00
parent 2f8fdb755b
commit 89fb745e74
20 changed files with 849 additions and 17 deletions
+22 -6
View File
@@ -36,7 +36,7 @@ class SteamGameOut(Schema):
@staticmethod
def resolve_store_url(obj) -> str:
return f"https://store.steampowered.com/app/{obj.steam_app_id}"
return obj.store_url
@staticmethod
def resolve_header_image(obj) -> str:
@@ -47,11 +47,7 @@ class SteamGameOut(Schema):
@staticmethod
def resolve_library_image(obj) -> str:
# Vertical capsule, like in the Steam library
return (
obj.library_image
or f"https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/{obj.steam_app_id}/library_600x900.jpg"
)
return obj.library_image_url
@staticmethod
def resolve_short_description(obj) -> str:
@@ -80,3 +76,23 @@ class SteamGameOut(Schema):
@staticmethod
def resolve_updated_at(obj) -> Optional[datetime]:
return obj.steam_info_updated_at
class PlanningGameOut(Schema):
name: str
# Empty when the name didn't match any of our games
library_image: str = ""
store_url: str = ""
steam_app_id: Optional[int] = None
class PlanningSlotOut(Schema):
id: int
title: str
begin: datetime
end: datetime
column: int
color: str
is_multi_anims: bool
# Single slot: the slot's game. Multi-anims: each of their games.
games: list[PlanningGameOut]