From bfb3addda44363d2d4a1153335e83f9d25fc3ebf Mon Sep 17 00:00:00 2001 From: Sam Dornan Date: Sat, 26 Sep 2026 15:48:46 +0000 Subject: [PATCH] fix: satisfy the new mypy test check and em dash lint rule master now runs mypy over backend/tests and flags em dashes in comments. Narrow the optional ROMs the playlist upload tests read, drop a reload the multi-disc CD audio test never used, and replace the em dashes in the MediaTab comments this PR's file carries. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014XHgJG3xRgUKwuHJHwKkPg --- backend/tests/endpoints/roms/test_cd_audio.py | 3 --- .../tests/endpoints/roms/test_convert_to_folder.py | 9 +++++++-- .../src/v2/components/GameDetails/MediaTab.vue | 14 +++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/backend/tests/endpoints/roms/test_cd_audio.py b/backend/tests/endpoints/roms/test_cd_audio.py index 1581aac0e..58b81e958 100644 --- a/backend/tests/endpoints/roms/test_cd_audio.py +++ b/backend/tests/endpoints/roms/test_cd_audio.py @@ -315,9 +315,6 @@ def test_names_the_tracks_of_discs_that_share_a_sheet_name( category=RomFileCategory.GAME, ) ) - rom = db_rom_handler.get_rom(rom.id) - assert rom is not None - response = client.post( f"/api/roms/{rom.id}/soundtracks/cd-audio", headers=_auth(access_token) ) diff --git a/backend/tests/endpoints/roms/test_convert_to_folder.py b/backend/tests/endpoints/roms/test_convert_to_folder.py index 57549c276..8c4e7e830 100644 --- a/backend/tests/endpoints/roms/test_convert_to_folder.py +++ b/backend/tests/endpoints/roms/test_convert_to_folder.py @@ -405,6 +405,7 @@ def test_upload_to_a_disc_a_playlist_lists_returns_400( assert (roms_dir / DISC_1).read_bytes() == b"romdata" assert not (roms_dir / "Game (Disc 1)").exists() after = db_rom_handler.get_rom(rom.id) + assert after is not None assert after.fs_name == DISC_1 assert [f.file_name for f in after.files] == [DISC_1] @@ -434,7 +435,9 @@ def test_upload_to_a_lone_disc_no_playlist_lists_promotes_it( assert response.status_code == status.HTTP_201_CREATED assert (roms_dir / "Game (Disc 1)" / DISC_1).read_bytes() == b"romdata" assert not (roms_dir / DISC_1).exists() - assert db_rom_handler.get_rom(rom.id).fs_name == "Game (Disc 1)" + after = db_rom_handler.get_rom(rom.id) + assert after is not None + assert after.fs_name == "Game (Disc 1)" def test_gamefaqs_import_to_a_disc_a_playlist_lists_returns_400( @@ -461,7 +464,9 @@ def test_gamefaqs_import_to_a_disc_a_playlist_lists_returns_400( assert "Game.m3u" in response.json()["detail"] fetch.assert_not_called() assert (roms_dir / DISC_1).exists() - assert db_rom_handler.get_rom(rom.id).fs_name == DISC_1 + after = db_rom_handler.get_rom(rom.id) + assert after is not None + assert after.fs_name == DISC_1 async def test_second_upload_racing_a_promotion_keeps_the_rom_in_its_folder( diff --git a/frontend/src/v2/components/GameDetails/MediaTab.vue b/frontend/src/v2/components/GameDetails/MediaTab.vue index 98dbd7673..52e84de5b 100644 --- a/frontend/src/v2/components/GameDetails/MediaTab.vue +++ b/frontend/src/v2/components/GameDetails/MediaTab.vue @@ -262,11 +262,11 @@ async function deleteSoundtrack(fileId: number) {
-
@@ -282,13 +282,13 @@ async function deleteSoundtrack(fileId: number) { />
-
-
@@ -373,7 +373,7 @@ async function deleteSoundtrack(fileId: number) { gap: 24px; /* Fills the parent tab panel exactly so the PDF viewer (inside the manual section) can size to 100% without forcing the outer panel - to scroll — the PDF has its own internal scroll. */ + to scroll, since the PDF has its own internal scroll. */ height: 100%; min-height: 0; } @@ -393,7 +393,7 @@ async function deleteSoundtrack(fileId: number) { min-height: 0; } -/* Panels — each subtab section fills the content height so its +/* Panels: each subtab section fills the content height so its children (manual / soundtrack / screenshots) can stretch to 100% without forcing an outer scrollbar. */ .r-v2-media__panel { @@ -442,7 +442,7 @@ html[data-bp~="sm-and-down"] .r-v2-media { gap: 14px; } -/* Soundtrack — the v1 player has its own internal styling; wrap in an +/* Soundtrack: the v1 player has its own internal styling; wrap in an elevated container so it blends with v2 tokens. */ .r-v2-media__soundtrack { border: 1px solid var(--r-color-border);