mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
Changes automatically made by [`pyupgrade`](https://github.com/asottile/pyupgrade), using the `--py311-plus` flag, to be compatible with Python 3.11.
54 lines
1017 B
Python
54 lines
1017 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
from typing_extensions import TypedDict
|
|
|
|
|
|
class BaseAsset(BaseModel):
|
|
id: int
|
|
rom_id: int
|
|
user_id: int
|
|
file_name: str
|
|
file_name_no_tags: str
|
|
file_name_no_ext: str
|
|
file_extension: str
|
|
file_path: str
|
|
file_size_bytes: int
|
|
full_path: str
|
|
download_path: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class ScreenshotSchema(BaseAsset):
|
|
pass
|
|
|
|
|
|
class UploadedScreenshotsResponse(TypedDict):
|
|
uploaded: int
|
|
screenshots: list[ScreenshotSchema]
|
|
merged_screenshots: list[str]
|
|
|
|
|
|
class SaveSchema(BaseAsset):
|
|
emulator: str | None
|
|
screenshot: ScreenshotSchema | None
|
|
|
|
|
|
class UploadedSavesResponse(TypedDict):
|
|
uploaded: int
|
|
saves: list[SaveSchema]
|
|
|
|
|
|
class StateSchema(BaseAsset):
|
|
emulator: str | None
|
|
screenshot: ScreenshotSchema | None
|
|
|
|
|
|
class UploadedStatesResponse(TypedDict):
|
|
uploaded: int
|
|
states: list[StateSchema]
|