mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
more changes from bot review
This commit is contained in:
@@ -481,24 +481,14 @@ def get_roms(
|
||||
filter_query = db_rom_handler.filter_roms(
|
||||
query=unfiltered_query,
|
||||
user_id=request.user.id,
|
||||
platform_ids=platform_ids,
|
||||
collection_id=collection_id,
|
||||
virtual_collection_id=virtual_collection_id,
|
||||
smart_collection_id=smart_collection_id,
|
||||
search_term=search_term,
|
||||
)
|
||||
query_filters = db_rom_handler.with_filter_values(query=filter_query)
|
||||
filter_values = RomFiltersDict(
|
||||
genres=query_filters["genres"],
|
||||
franchises=query_filters["franchises"],
|
||||
collections=query_filters["collections"],
|
||||
companies=query_filters["companies"],
|
||||
game_modes=query_filters["game_modes"],
|
||||
age_ratings=query_filters["age_ratings"],
|
||||
player_counts=query_filters["player_counts"],
|
||||
regions=query_filters["regions"],
|
||||
languages=query_filters["languages"],
|
||||
platforms=query_filters["platforms"],
|
||||
)
|
||||
filter_values = RomFiltersDict(**query_filters)
|
||||
|
||||
# Get all ROM IDs in order for the additional data
|
||||
with sync_session.begin() as session:
|
||||
@@ -718,18 +708,7 @@ async def get_rom_filters(request: Request) -> RomFiltersDict:
|
||||
|
||||
filters = db_rom_handler.get_rom_filters()
|
||||
|
||||
return RomFiltersDict(
|
||||
genres=filters["genres"],
|
||||
franchises=filters["franchises"],
|
||||
collections=filters["collections"],
|
||||
companies=filters["companies"],
|
||||
game_modes=filters["game_modes"],
|
||||
age_ratings=filters["age_ratings"],
|
||||
player_counts=filters["player_counts"],
|
||||
regions=filters["regions"],
|
||||
languages=filters["languages"],
|
||||
platforms=filters["platforms"],
|
||||
)
|
||||
return RomFiltersDict(**filters)
|
||||
|
||||
|
||||
@protected_route(
|
||||
|
||||
@@ -1247,15 +1247,24 @@ class DBRomsHandler(DBBaseHandler):
|
||||
|
||||
for row in session.execute(statement):
|
||||
g, f, cl, co, gm, ar, pc, rg, lg, pid = row
|
||||
genres.update(g)
|
||||
franchises.update(f)
|
||||
collections.update(cl)
|
||||
companies.update(co)
|
||||
game_modes.update(gm)
|
||||
age_ratings.update(ar)
|
||||
player_counts.update(pc)
|
||||
regions.update(rg)
|
||||
languages.update(lg)
|
||||
if g:
|
||||
genres.update(g)
|
||||
if f:
|
||||
franchises.update(f)
|
||||
if cl:
|
||||
collections.update(cl)
|
||||
if co:
|
||||
companies.update(co)
|
||||
if gm:
|
||||
game_modes.update(gm)
|
||||
if ar:
|
||||
age_ratings.update(ar)
|
||||
if pc:
|
||||
player_counts.add(pc)
|
||||
if rg:
|
||||
regions.update(rg)
|
||||
if lg:
|
||||
languages.update(lg)
|
||||
platforms.add(pid)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user