-
-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fancy Game Search #5442
Merged
Merged
Fancy Game Search #5442
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
danieljohnson2
force-pushed
the
dj/fancy_search
branch
from
April 28, 2024 12:17
1be2f8d
to
433ec86
Compare
danieljohnson2
force-pushed
the
dj/fancy_search
branch
from
May 8, 2024 21:20
433ec86
to
cd97a7a
Compare
This sort of works, but sometimes the same game is both installed and not somehow.
I'm thinking runner search!
…hout a service. To do this, I've put a reference to the service in GameSearch as a field.
This means you can now search for installed (or non-installed) runners. Yay!
…' to search categories. Sadly the category is case-sensitive for now.
More or less; SQLite COLLATE NOCASE is apparently crappy, but it's better than nothing.
This should support editing searches later, even editing invalid ones.
Also, make hidden and installed override the menu-based settings, so they can be used from the Game view freely. This does mean doing less of the search in SQL, but I suspect this won't be a problem.
'installed:maybe' is also useful; you can override the UI menu settings with these. 'hidden:maybe' is useful to show hidden and non-hidden together. You can use 'maybe' with other components, but it does nothing useful for them.
…cutive text segments so text is order sensitive, and "-alien shooter" applies the negation to the whole thing.
…dling the OR conjunction
…ards, allowing lookahead.
But this is still super messy.
…han None to indicate 'bad tagness'. This way the read_flag_token() function can return None for 'maybe', and raise for 'invalid argument'
…s, but the equals match is too precise to be useful. The search syntax is "playtime: >9 hours 3 minutes"; quotes are allowed but not required.
…ed tokens. This way 'playtime: 20 hours' can be parsed, as this tag along can read the rest of the text to the next stop.
… hours playtime:<=20 hours" will work with no explicit AND.
This is treated as a duration, meaning how long ago you last played it. We can expand on this later.
…ate match so: playtime:2 hours -> playtime rounded to hours is 2 hours playtime:120 minutes -> playtime rounded to minutes is 120 minutes These are not the same thing!
Thus, platform:win finds Windows, and runner:win finds Wine, and so on. This should be more forgiving for messy carbon based life forms.
It will not be stop token, so a search for "Ex-Zodiac" finds just that even without quotes; '-' must be at the start to count as negation. You can write Ex AND -Zodiac or "Ex" -Zodiac to override this.
danieljohnson2
force-pushed
the
dj/fancy_search
branch
from
May 12, 2024 11:17
cd97a7a
to
898a7f3
Compare
Thanks for the early merge! Now I need to figure out a UI for saving these as 'dynamic categories'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds fancy search terms to the game search, and the runner search to boot. There are logical operators and 'tagged' searches that can match attributes of games. Some of them can override 'built in' filtering, so you can get views otherwise impossible.
There's almost no UI, just some tooltips. But hardcore Linux kernel hackers can probably manage a UI that works rather like Google search.
It's my hope that this will be the foundation for future features. I intend that you should sometime be able to save one o these searches a user-defined dynamic category, for instance. And we want a better UI to build fancy searches that just typing them in. But this seems to me to be a good start.
Stand by for screenshots! All the screenshots!
Here we see OR, which must be in all-caps, to find two sets of games:
Let's get fancier, with AND and the 'installed' attribute and some parentheses:
AND is mostly redundant though, and we assume AND if you have no conjunction. Like Google, we use "-" for negation, but there's some subtlty here.
Here's a search leaving out that time when there's only war:
But this still works:
Because the - is not initial here. To get it to treat - as negation, an explicit AND can help:
Because these tags override built in filters, we can do tricks. We can show hidden games in a category:
Just to be extra cute, you can conveniently get both hidden and visible games at once, like this:
You could do this with
hidden:true OR hidden:false
as well, but this is cuter.Some tags are a bit fancier. Here's the games that took way too long:
But here's a more specific search:
Here, the search is matching games where the playtime rounds to 21 hours (ie, nearer that than 20 or 22 hours). This is about the only way to make that useful; exactly 21 hours is very unlikely. But change the search to
playtime:20 hours 52 minutes
and it rounds to the minute instead.Here's one for the last-played time:
This is a bit limited. I could find no way to parse a date-time from a user (ie, without a specific format string), so you can only specify last-played in relative terms. These are the games I last played 3 months ago.
Here's a list of the tags supported, taken from the tooltip:
installed:true Only installed games.
hidden:true Only hidden games.
favorite:true Only favorite games.
categorized:true Only games in a category.
category:x Only games in category x.
source:steam Only Steam games
runner:wine Only Wine games
platform:windows Only Windows games
playtime:>2 hours Only games played for more than 2 hours.
lastplayed:<2 days Only games played in the last 2 days.
directory:game/dir Only games at the path.
Finally, this stuff also works in the runners tab of the preferences. Just so I can do this: