diff --git a/backend/endpoints/responses/rom.py b/backend/endpoints/responses/rom.py index 3a4ef5855..5249f0cb8 100644 --- a/backend/endpoints/responses/rom.py +++ b/backend/endpoints/responses/rom.py @@ -2,10 +2,10 @@ from __future__ import annotations import re from datetime import datetime, timezone -from typing import Annotated, NotRequired, TypedDict, get_type_hints +from typing import NotRequired, TypedDict, get_type_hints from fastapi import Request -from pydantic import Field, computed_field, field_validator +from pydantic import computed_field, field_validator from endpoints.responses.assets import SaveSchema, ScreenshotSchema, StateSchema from handler.metadata.flashpoint_handler import FlashpointMetadata @@ -261,8 +261,6 @@ class RomSchema(BaseModel): md5_hash: str | None sha1_hash: str | None - # TODO: Remove this after 4.3 release - multi: Annotated[bool, Field(deprecated="Replaced by has_multiple_files")] has_simple_single_file: bool has_nested_single_file: bool has_multiple_files: bool @@ -274,6 +272,8 @@ class RomSchema(BaseModel): siblings: list[SiblingRomSchema] rom_user: RomUserSchema + merged_screenshots: list[str] + merged_ra_metadata: RomRAMetadata | None class Config: from_attributes = True @@ -360,8 +360,6 @@ class UserCollectionSchema(BaseModel): class DetailedRomSchema(RomSchema): - merged_ra_metadata: RomRAMetadata | None - merged_screenshots: list[str] user_saves: list[SaveSchema] user_states: list[StateSchema] user_screenshots: list[ScreenshotSchema] diff --git a/backend/models/rom.py b/backend/models/rom.py index 90af0e00a..3ff7d9676 100644 --- a/backend/models/rom.py +++ b/backend/models/rom.py @@ -385,7 +385,7 @@ class Rom(BaseModel): or [] ) - @property + @cached_property def merged_ra_metadata(self) -> dict[str, list] | None: if self.ra_metadata and "achievements" in self.ra_metadata: for achievement in self.ra_metadata.get("achievements", []): diff --git a/frontend/src/__generated__/models/DetailedRomSchema.ts b/frontend/src/__generated__/models/DetailedRomSchema.ts index 547b1d3a6..41f992f05 100644 --- a/frontend/src/__generated__/models/DetailedRomSchema.ts +++ b/frontend/src/__generated__/models/DetailedRomSchema.ts @@ -74,10 +74,6 @@ export type DetailedRomSchema = { crc_hash: (string | null); md5_hash: (string | null); sha1_hash: (string | null); - /** - * @deprecated - */ - multi: boolean; has_simple_single_file: boolean; has_nested_single_file: boolean; has_multiple_files: boolean; diff --git a/frontend/src/__generated__/models/RomGamelistMetadata.ts b/frontend/src/__generated__/models/RomGamelistMetadata.ts index e7702cdbd..7000eb61f 100644 --- a/frontend/src/__generated__/models/RomGamelistMetadata.ts +++ b/frontend/src/__generated__/models/RomGamelistMetadata.ts @@ -16,11 +16,6 @@ export type RomGamelistMetadata = { thumbnail_url?: (string | null); title_screen_url?: (string | null); video_url?: (string | null); - box3d_path?: (string | null); - miximage_path?: (string | null); - physical_path?: (string | null); - marquee_path?: (string | null); - video_path?: (string | null); rating?: (number | null); first_release_date?: (string | null); companies?: (Array | null); @@ -28,5 +23,10 @@ export type RomGamelistMetadata = { genres?: (Array | null); player_count?: (string | null); md5_hash?: (string | null); + box3d_path?: (string | null); + miximage_path?: (string | null); + physical_path?: (string | null); + marquee_path?: (string | null); + video_path?: (string | null); }; diff --git a/frontend/src/__generated__/models/RomSSMetadata.ts b/frontend/src/__generated__/models/RomSSMetadata.ts index c966dd5e0..2bbb83469 100644 --- a/frontend/src/__generated__/models/RomSSMetadata.ts +++ b/frontend/src/__generated__/models/RomSSMetadata.ts @@ -21,7 +21,9 @@ export type RomSSMetadata = { video_url?: (string | null); video_normalized_url?: (string | null); bezel_path?: (string | null); + box2d_back_path?: (string | null); box3d_path?: (string | null); + fanart_path?: (string | null); miximage_path?: (string | null); physical_path?: (string | null); marquee_path?: (string | null); diff --git a/frontend/src/__generated__/models/SimpleRomSchema.ts b/frontend/src/__generated__/models/SimpleRomSchema.ts index 20fe834fc..f1ac66722 100644 --- a/frontend/src/__generated__/models/SimpleRomSchema.ts +++ b/frontend/src/__generated__/models/SimpleRomSchema.ts @@ -11,6 +11,7 @@ import type { RomIGDBMetadata } from './RomIGDBMetadata'; import type { RomLaunchboxMetadata } from './RomLaunchboxMetadata'; import type { RomMetadataSchema } from './RomMetadataSchema'; import type { RomMobyMetadata } from './RomMobyMetadata'; +import type { RomRAMetadata } from './RomRAMetadata'; import type { RomSSMetadata } from './RomSSMetadata'; import type { RomUserSchema } from './RomUserSchema'; import type { SiblingRomSchema } from './SiblingRomSchema'; @@ -68,10 +69,6 @@ export type SimpleRomSchema = { crc_hash: (string | null); md5_hash: (string | null); sha1_hash: (string | null); - /** - * @deprecated - */ - multi: boolean; has_simple_single_file: boolean; has_nested_single_file: boolean; has_multiple_files: boolean; @@ -82,5 +79,7 @@ export type SimpleRomSchema = { missing_from_fs: boolean; siblings: Array; rom_user: RomUserSchema; + merged_ra_metadata: (RomRAMetadata | null); + merged_screenshots: Array; }; diff --git a/frontend/src/__generated__/models/UserNoteSchema.ts b/frontend/src/__generated__/models/UserNoteSchema.ts index adf1f5810..b4ef9a531 100644 --- a/frontend/src/__generated__/models/UserNoteSchema.ts +++ b/frontend/src/__generated__/models/UserNoteSchema.ts @@ -7,10 +7,7 @@ export type UserNoteSchema = { title: string; content: string; is_public: boolean; - tags?: Array | null; - metadata?: Record | null; - shared_with_users?: Array | null; - collaboration_level?: string | null; + tags?: (Array | null); created_at: string; updated_at: string; user_id: number;