Trunk format fixes.

This commit is contained in:
DevOldSchool
2026-01-05 13:05:13 +10:00
parent 331ed76187
commit bdc6fc5235
4 changed files with 23 additions and 13 deletions

View File

@@ -463,12 +463,12 @@ class DBRomsHandler(DBBaseHandler):
return query.filter(op(Rom.languages, values, session=session))
def filter_by_player_counts(
self,
query: Query,
*,
session: Session,
values: Sequence[str],
match_all: bool = False,
self,
query: Query,
*,
session: Session,
values: Sequence[str],
match_all: bool = False,
) -> Query:
return query.filter(RomMetadata.player_count.in_(values))

View File

@@ -88,7 +88,7 @@ def test_update_rom(
"genres": '[{"id": 5, "name": "Shooter"}, {"id": 8, "name": "Platform"}, {"id": 31, "name": "Adventure"}]',
"franchises": '[{"id": 756, "name": "Metroid"}]',
"collections": '[{"id": 243, "name": "Metroid"}, {"id": 6240, "name": "Metroid Prime"}]',
"player_count": '1',
"player_count": "1",
"expansions": "[]",
"dlcs": "[]",
"companies": '[{"id": 203227, "company": {"id": 70, "name": "Nintendo"}}, {"id": 203307, "company": {"id": 766, "name": "Retro Studios"}}]',

View File

@@ -224,7 +224,9 @@ function onFilterClick(filter: FilterType, value: string) {
<v-col>
<template v-if="Array.isArray(get(rom, filter.path))">
<v-chip
v-for="value in get(rom, filter.path).filter((v: string) => !!v)"
v-for="value in get(rom, filter.path).filter(
(v: string) => !!v,
)"
:key="value"
size="small"
variant="outlined"

View File

@@ -359,9 +359,13 @@ function setFilters() {
...new Set(romsForFilters.flatMap((rom) => rom.languages).sort()),
]);
galleryFilterStore.setFilterPlayerCounts([
...new Set(romsForFilters.map((rom) => rom.metadatum.player_count).filter(Boolean).sort(),
),
]);
...new Set(
romsForFilters
.map((rom) => rom.metadatum.player_count)
.filter(Boolean)
.sort(),
),
]);
// Note: filterStatuses is static and doesn't need to be set dynamically
}
@@ -559,10 +563,14 @@ onMounted(async () => {
}
if (urlPlayerCounts !== undefined) {
const playerCounts = (urlPlayerCounts as string).split(",").filter((pc) => pc.trim());
const playerCounts = (urlPlayerCounts as string)
.split(",")
.filter((pc) => pc.trim());
galleryFilterStore.setSelectedFilterPlayerCounts(playerCounts);
if (urlPlayerCountsLogic !== undefined) {
galleryFilterStore.setPlayerCountsLogic(urlPlayerCountsLogic as "any" | "all");
galleryFilterStore.setPlayerCountsLogic(
urlPlayerCountsLogic as "any" | "all",
);
}
}