From bec984671897062867c845ab9da2caa4069bd91c Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Sat, 29 Aug 2026 16:46:51 -0400 Subject: [PATCH] refactor(firmware): trim comments and name the platform list Cut the comment blocks that ran past two lines, and rename platformItems to affectedPlatforms since it holds only the platforms that have missing firmware, unlike the all-platforms list of the same name in MissingGamesSection. Co-Authored-By: Claude Opus 5 (1M context) --- backend/endpoints/responses/platform.py | 5 ++--- backend/handler/database/firmware_handler.py | 5 ++--- .../Settings/MissingFirmwareSection.vue | 14 ++++++-------- .../v2/composables/useTaskCompletion/index.ts | 17 ++++++----------- frontend/src/v2/utils/playerFirmware.ts | 12 ++++-------- 5 files changed, 20 insertions(+), 33 deletions(-) diff --git a/backend/endpoints/responses/platform.py b/backend/endpoints/responses/platform.py index 42fdb72de..7cdf8aa34 100644 --- a/backend/endpoints/responses/platform.py +++ b/backend/endpoints/responses/platform.py @@ -46,9 +46,8 @@ class PlatformSchema(BaseModel): def display_name(self) -> str: return self.custom_name or self.name - # Counts every row, missing ones included, so it means the same as - # `rom_count`. Callers that want only usable BIOS filter `firmware`, - # which ships with this schema. + # Counts every row like `rom_count` does; callers wanting only usable + # BIOS filter the `firmware` list that ships alongside it. @computed_field # type: ignore @property def firmware_count(self) -> int: diff --git a/backend/handler/database/firmware_handler.py b/backend/handler/database/firmware_handler.py index 621d82bb9..0ba75c02a 100644 --- a/backend/handler/database/firmware_handler.py +++ b/backend/handler/database/firmware_handler.py @@ -37,9 +37,8 @@ class DBFirmwareHandler(DBBaseHandler): hidden_platform_ids: Sequence[int] | None = None, session: Session = None, # type: ignore ) -> Sequence[Firmware]: - # `Firmware.platform` is `lazy="joined"`, which drags in Platform's - # rom_count / fs_size_bytes aggregate subqueries over `roms`. No - # caller here reads the relationship, so keep it out of the query. + # `Firmware.platform` is lazy="joined", which drags in Platform's + # rom_count and fs_size_bytes subqueries. No caller here reads it. query = ( select(Firmware) .options(noload(Firmware.platform)) diff --git a/frontend/src/v2/components/Settings/MissingFirmwareSection.vue b/frontend/src/v2/components/Settings/MissingFirmwareSection.vue index 8ed695b66..bf6a2eb5d 100644 --- a/frontend/src/v2/components/Settings/MissingFirmwareSection.vue +++ b/frontend/src/v2/components/Settings/MissingFirmwareSection.vue @@ -1,7 +1,6 @@