final manual clenaup

This commit is contained in:
Georges-Antoine Assi
2026-01-18 22:51:43 -05:00
parent bddb7bd9f5
commit 6eb888416f
2 changed files with 0 additions and 18 deletions

View File

@@ -1650,8 +1650,6 @@ async def get_rom_notes(
tags: list[str] = DEFAULT_TAGS,
) -> list[UserNoteSchema]:
"""Get all notes for a ROM."""
from handler.database import db_rom_handler
rom = db_rom_handler.get_rom(id)
if not rom:
raise RomNotFoundInDatabaseException(id)
@@ -1681,8 +1679,6 @@ async def get_rom_note_identifiers(
id: Annotated[int, PathVar(description="Rom internal id.", ge=1)],
) -> list[int]:
"""Get all note identifiers for a ROM."""
from handler.database import db_rom_handler
rom = db_rom_handler.get_rom(id)
if not rom:
raise RomNotFoundInDatabaseException(id)
@@ -1708,8 +1704,6 @@ async def create_rom_note(
note_data: Annotated[dict, Body()],
) -> UserNoteSchema:
"""Create a new note for a ROM."""
from handler.database import db_rom_handler
rom = db_rom_handler.get_rom(id)
if not rom:
raise RomNotFoundInDatabaseException(id)
@@ -1741,8 +1735,6 @@ async def update_rom_note(
note_data: Annotated[dict, Body()],
) -> UserNoteSchema:
"""Update a ROM note."""
from handler.database import db_rom_handler
note = db_rom_handler.update_rom_note(
note_id=note_id,
user_id=request.user.id,
@@ -1775,8 +1767,6 @@ async def delete_rom_note(
note_id: Annotated[int, PathVar(description="Note id.", ge=1)],
) -> dict:
"""Delete a ROM note."""
from handler.database import db_rom_handler
success = db_rom_handler.delete_rom_note(note_id=note_id, user_id=request.user.id)
if not success:

View File

@@ -724,7 +724,6 @@ class DBRomsHandler(DBBaseHandler):
order_by: str = "name",
order_dir: str = "asc",
user_id: int | None = None,
only_fields: Sequence[QueryableAttribute] | None = None,
query: Query = None, # type: ignore
session: Session = None, # type: ignore
) -> tuple[Query[Rom], Any]:
@@ -758,9 +757,6 @@ class DBRomsHandler(DBBaseHandler):
else:
order_attr = order_attr.asc()
if only_fields:
query = query.options(load_only(*only_fields))
return query.order_by(order_attr), order_attr_column
@begin_session
@@ -864,7 +860,6 @@ class DBRomsHandler(DBBaseHandler):
self,
platform_id: int,
fs_names: Iterable[str],
only_fields: Sequence[QueryableAttribute] | None = None,
query: Query = None, # type: ignore
session: Session = None, # type: ignore
) -> dict[str, Rom]:
@@ -873,9 +868,6 @@ class DBRomsHandler(DBBaseHandler):
platform_id=platform_id
)
if only_fields:
query = query.options(load_only(*only_fields))
roms = session.scalars(query).unique().all()
return {rom.fs_name: rom for rom in roms}