mirror of
https://github.com/rommapp/romm.git
synced 2026-12-03 10:33:22 +01:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014XHgJG3xRgUKwuHJHwKkPg
This commit is contained in:
@@ -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)
|
||||
)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -262,11 +262,11 @@ async function deleteSoundtrack(fileId: number) {
|
||||
<div class="r-v2-media__content">
|
||||
<!-- All subtab sections stay mounted (v-show, not v-if). The manual,
|
||||
soundtrack and screenshots panels are heavy defineAsyncComponent
|
||||
loads — un/remounting them on every subtab switch causes a visible
|
||||
loads, and un/remounting them on every subtab switch causes a visible
|
||||
main-thread freeze (the PDF parser is the worst offender). With
|
||||
v-show the cost is paid once on Media tab entry and switching is a
|
||||
CSS toggle. -->
|
||||
<!-- Manual subtab — its own component (PDF / Markdown viewer with an
|
||||
<!-- Manual subtab: its own component (PDF / Markdown viewer with an
|
||||
entry selector; scrolls independently). -->
|
||||
<section v-show="subTab === 'manual'" class="r-v2-media__panel">
|
||||
<ManualSubtab ref="manualPanel" :rom="rom" :hide-upload="smAndDown" />
|
||||
@@ -282,13 +282,13 @@ async function deleteSoundtrack(fileId: number) {
|
||||
/>
|
||||
</section>
|
||||
|
||||
<!-- Screenshots subtab — its own component (ROM / Mine / Community
|
||||
<!-- Screenshots subtab: its own component (ROM / Mine / Community
|
||||
sections, per-user public/private). -->
|
||||
<section v-show="subTab === 'screenshots'" class="r-v2-media__panel">
|
||||
<ScreenshotsSubtab :rom="rom" />
|
||||
</section>
|
||||
|
||||
<!-- Artwork subtab — read-only gallery of scraped art assets
|
||||
<!-- Artwork subtab: read-only gallery of scraped art assets
|
||||
(bezel / logo / marquee / box art / fan art / videos). -->
|
||||
<section v-show="subTab === 'artwork'" class="r-v2-media__panel">
|
||||
<ArtworkSubtab :rom="rom" />
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user