Skip to content

fix: add missing platforms to playable game filter#3121

Merged
zurdi15 merged 4 commits intorommapp:masterfrom
Bergbok:playable-filter-fix
Mar 11, 2026
Merged

fix: add missing platforms to playable game filter#3121
zurdi15 merged 4 commits intorommapp:masterfrom
Bergbok:playable-filter-fix

Conversation

@Bergbok
Copy link
Copy Markdown
Contributor

@Bergbok Bergbok commented Mar 11, 2026

Description

Noticed some games not showing up in my "playable" smart collection, turns out a couple supported platforms weren't included in the _filter_by_playable function.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR fixes the "playable" smart collection filter by adding three missing EJS-supported platforms (DOS, GBC, SEGA32) and introducing a new OTHER_SUPPORTED_PLATFORMS list to account for the BROWSER platform (served via Ruffle), which uses a different playback mechanism than EmulatorJS. It also removes a pre-existing duplicate UPS.C64 entry.

  • UPS.DOS, UPS.GBC, and UPS.SEGA32 are correctly added to EJS_SUPPORTED_PLATFORMS — all three are confirmed in the frontend's _EJS_CORES_MAP (dosbox_pure, gambatte/mgba, and picodrive respectively).
  • OTHER_SUPPORTED_PLATFORMS with UPS.BROWSER is a clean design choice to separate EJS-based emulation from Ruffle-based playback (["flash", "browser"] is the Ruffle-supported check in the frontend).
  • UPS.SWANCRYSTAL (swancrystal) appears to be another EJS-supported platform (mednafen_wswan core, same as wonderswan and wonderswan-color) that was not included in this fix and is still absent from EJS_SUPPORTED_PLATFORMS.
  • The or_() wrapping of two .in_() calls in _filter_by_playable is functionally correct but could be simplified to a single .in_() with a combined list.

Confidence Score: 4/5

  • Safe to merge — changes are additive and logically correct with no risk of regressions.
  • All newly added platform slugs (DOS, GBC, SEGA32, BROWSER) are verified to exist in UniversalPlatformSlug and are confirmed as playable in the frontend. The or_() + not_() logic is correct. The only concern is that UPS.SWANCRYSTAL appears to be in the same situation as the platforms this PR fixes but was overlooked.
  • No files require special attention beyond the single changed file.

Important Files Changed

Filename Overview
backend/handler/database/roms_handler.py Adds DOS, GBC, SEGA32 to EJS_SUPPORTED_PLATFORMS; introduces OTHER_SUPPORTED_PLATFORMS for BROWSER (Ruffle); updates filter_by_playable with or(). Logic is correct but UPS.SWANCRYSTAL appears to also be missing from EJS_SUPPORTED_PLATFORMS.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[_filter_by_playable called] --> B{value == True?}
    B -- Yes --> C["predicate = or(\n  slug IN EJS_SUPPORTED_PLATFORMS,\n  slug IN OTHER_SUPPORTED_PLATFORMS\n)"]
    B -- No --> D["predicate = not_(or(\n  slug IN EJS_SUPPORTED_PLATFORMS,\n  slug IN OTHER_SUPPORTED_PLATFORMS\n))"]
    C --> E[query.join Platform .filter predicate]
    D --> E

    subgraph EJS_SUPPORTED_PLATFORMS
        F["3DO, AMIGA, ARCADE, ATARI*, C64, DOS ✨\nGBC ✨, SEGA32 ✨, GBA, NES, N64\nNDS, PSX, PSP, GENESIS, SNES, ..."]
    end

    subgraph OTHER_SUPPORTED_PLATFORMS
        G["BROWSER ✨ (Ruffle)"]
    end

    C --> EJS_SUPPORTED_PLATFORMS
    C --> OTHER_SUPPORTED_PLATFORMS
Loading

Comments Outside Diff (1)

  1. backend/handler/database/roms_handler.py, line 96-98 (link)

    UPS.SWANCRYSTAL also missing from EJS_SUPPORTED_PLATFORMS

    While this PR correctly adds GBC, DOS, SEGA32, and BROWSER, the Wonder Swan Crystal (swancrystal) appears to also be an EJS-supported platform. The frontend's _EJS_CORES_MAP in frontend/src/utils/index.ts maps swancrystal to the mednafen_wswan core (the same core used for wonderswan and wonderswan-color), and UPS.SWANCRYSTAL = "swancrystal" exists in UniversalPlatformSlug. It is currently absent from EJS_SUPPORTED_PLATFORMS, which means WonderSwan Crystal games would still be excluded from the "playable" smart collection.

Last reviewed commit: 99e41ce

Copy link
Copy Markdown
Member

@zurdi15 zurdi15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is UPS.BROWSER? if its the flash games/browser games platform, add it to the list, don't make an or in the predicate

Edit: UPS.BROWSER already exists in the UPS object, so add it to the EJS_SUPPORTED_PLATFORMS list or create a new list OTHER_SUPPORTED_PLATFORMS and add it there so if in the future we add a new playable platform from outside of emujs we will add it there

@Bergbok
Copy link
Copy Markdown
Contributor Author

Bergbok commented Mar 11, 2026

Okay, I created a OTHER_SUPPORTED_PLATFORMS list since browser games are using Ruffle not EmulatorJS. @zurdi15

@zurdi15 zurdi15 merged commit 4c680f4 into rommapp:master Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants