Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
76f613d
style: enhance scrollbar appearance with rounded edges and improved d…
zurdi15 Jun 12, 2025
b52ea89
feat: add 'missing' flag to platforms and roms, update related handle…
zurdi15 Jun 12, 2025
dab9421
fix: update rom missing status handling in scan and platform handlers
zurdi15 Jun 12, 2025
82b54c4
feat: add MissingFromFSIcon component and integrate missing flags acr…
zurdi15 Jun 12, 2025
6db62bf
style: remove rounded prop from file items in FileInfo component
zurdi15 Jun 12, 2025
e31c4de
fix: conditionally render MissingFromFSIcon based on rom.missing status
zurdi15 Jun 12, 2025
df59e8e
feat: integrate MissingFromFSIcon for missing platform indication in …
zurdi15 Jun 12, 2025
6a77f3a
fix: initialize missing status for platforms and update rom missing s…
zurdi15 Jun 12, 2025
8b0a06c
feat: add 'missing' column to multiple tables and update related hand…
zurdi15 Jun 12, 2025
cb01b82
feat: add 'missing' property to asset and firmware schemas for tracki…
zurdi15 Jun 12, 2025
fdb795d
feat: add missing filter options in API and database handlers for ROMs
zurdi15 Jun 12, 2025
cbc7b9c
feat: enhance logging for save uploads and improve missing firmware/p…
zurdi15 Jun 12, 2025
a3a3779
fix: correct assertions in platform and ROM tests to reflect expected…
zurdi15 Jun 12, 2025
2e76e4d
feat: add missing property to FirmwareSchema for tracking missing fir…
zurdi15 Jun 12, 2025
8370b79
feat: add 'missing_from_fs' property to various schemas and update re…
zurdi15 Jun 12, 2025
48ed181
feat: rename 'missing' property to 'missing_from_fs' in various schem…
zurdi15 Jun 12, 2025
81f9a10
feat: add 'show-missing' property to platform localization files for …
zurdi15 Jun 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions backend/alembic/versions/0042_add_missing_rom_flag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""empty message

Revision ID: 0042_add_missing_fields
Revises: 0041_assets_t_thumb_cleanup
Create Date: 2025-06-11

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "0042_add_missing_fields"
down_revision = "0041_assets_t_thumb_cleanup"
branch_labels = None
depends_on = None


def upgrade():
with op.batch_alter_table("platforms", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
Comment thread
zurdi15 marked this conversation as resolved.
Outdated
)

with op.batch_alter_table("roms", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
)

with op.batch_alter_table("rom_files", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
)

with op.batch_alter_table("firmware", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
)

with op.batch_alter_table("saves", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
)

with op.batch_alter_table("states", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
)

with op.batch_alter_table("screenshots", schema=None) as batch_op:
batch_op.add_column(
sa.Column("missing", sa.Boolean(), nullable=False, server_default="0")
)


def downgrade():
with op.batch_alter_table("platforms", schema=None) as batch_op:
batch_op.drop_column("missing")

with op.batch_alter_table("roms", schema=None) as batch_op:
batch_op.drop_column("missing")

with op.batch_alter_table("rom_files", schema=None) as batch_op:
batch_op.drop_column("missing")

with op.batch_alter_table("firmware", schema=None) as batch_op:
batch_op.drop_column("missing")

with op.batch_alter_table("saves", schema=None) as batch_op:
batch_op.drop_column("missing")

with op.batch_alter_table("states", schema=None) as batch_op:
batch_op.drop_column("missing")

with op.batch_alter_table("screenshots", schema=None) as batch_op:
batch_op.drop_column("missing")
1 change: 1 addition & 0 deletions backend/endpoints/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def get_supported_platforms(request: Request) -> list[PlatformSchema]:
"created_at": now,
"updated_at": now,
"fs_size_bytes": 0,
"missing": False,
}

if platform["name"] in db_platforms_map:
Expand Down
3 changes: 3 additions & 0 deletions backend/endpoints/responses/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class BaseAsset(BaseModel):
file_size_bytes: int
full_path: str
download_path: str

missing: bool

created_at: datetime
updated_at: datetime

Expand Down
2 changes: 2 additions & 0 deletions backend/endpoints/responses/firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class FirmwareSchema(BaseModel):
md5_hash: str
sha1_hash: str

missing: bool

created_at: datetime
updated_at: datetime

Expand Down
2 changes: 2 additions & 0 deletions backend/endpoints/responses/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class PlatformSchema(BaseModel):
updated_at: datetime
fs_size_bytes: int

missing: bool

class Config:
from_attributes = True

Expand Down
2 changes: 2 additions & 0 deletions backend/endpoints/responses/rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ class RomSchema(BaseModel):
created_at: datetime
updated_at: datetime

missing: bool

class Config:
from_attributes = True

Expand Down
5 changes: 4 additions & 1 deletion backend/endpoints/rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def get_roms(
favourites_only: Annotated[bool, Query(deprecated=True)] = False,
duplicates_only: Annotated[bool, Query(deprecated=True)] = False,
playables_only: Annotated[bool, Query(deprecated=True)] = False,
missing_only: Annotated[bool, Query(deprecated=True)] = False,
ra_only: bool = False,
group_by_meta_id: bool = False,
selected_genre: str | None = None,
Expand Down Expand Up @@ -189,7 +190,8 @@ def get_roms(
favourites_only (bool, optional): Filter only favourite roms. Defaults to False. DEPRECATED: use `favourite` instead.
duplicates_only (bool, optional): Filter only duplicate roms. Defaults to False. DEPRECATED: use `duplicate` instead.
playables_only (bool, optional): Filter only playable roms by emulatorjs. Defaults to False. DEPRECATED: use `playable` instead.
ra_only (bool, optional): Filter only roms with Retroachievements compatibility.
ra_only (bool, optional): Filter only roms with Retroachievements compatibility. Defaults to False.
missing_only (bool, optional): Filter only roms that are missing from the filesystem. Defaults to False.
group_by_meta_id (bool, optional): Group roms by igdb/moby/ssrf ID. Defaults to False.
selected_genre (str, optional): Filter by genre. Defaults to None.
selected_franchise (str, optional): Filter by franchise. Defaults to None.
Expand Down Expand Up @@ -240,6 +242,7 @@ def get_roms(
duplicate=duplicate,
playable=playable,
ra_only=ra_only,
missing_only=missing_only,
selected_genre=selected_genre,
selected_franchise=selected_franchise,
selected_collection=selected_collection,
Expand Down
4 changes: 3 additions & 1 deletion backend/endpoints/saves.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ async def add_save(
if not rom:
raise RomNotFoundInDatabaseException(rom_id)

log.info(f"Uploading save {hl(saveFile.filename)} for {hl(rom.name, color=BLUE)}")
log.info(
f"Uploading save {hl(saveFile.filename)} for {hl(str(rom.name), color=BLUE)}"
)

saves_path = fs_asset_handler.build_saves_file_path(
user=request.user,
Expand Down
Loading
Loading