iftechfoundation / ifdb-suggestion-tracker

Bugs and feature requests for a future IFDB update
10 stars 0 forks source link

Implicit search by TUID only works if the game has an IFID #433

Closed dfabulich closed 6 months ago

dfabulich commented 6 months ago

In https://github.com/iftechfoundation/ifdb/pull/276 after much back and forth, I reimplemented implicit search by TUID, so you can search IFDB for aearuuxv83plclpl and it will take you directly to https://ifdb.org/viewgame?id=aearuuxv83plclpl

But it only works if the game has an IFID. For example, https://ifdb.org/viewgame?id=2glbsr1n5uevrnhs has no IFID, and you search for 2glbsr1n5uevrnhs it returns zero results.

This is happening because the preflight one-word search query looks like this:

select games.id from games join ifids on games.id = gameid where games.id = ? or lower_ifid=lower(?)

But that will only return results if it can find at least one IFID in the ifids table.