Daniel Johnson
e05ba61ede
Revert "Raise AuthenticationError from the service load() method if not authenticated."
...
This reverts commit f4d1e1a99f
.
2024-05-19 16:13:35 -04:00
Daniel Johnson
e77298ee83
Revert "Hook up the special exception backstops up in LutrisWindow.__init__."
...
This reverts commit b0c0e295fc
.
2024-05-19 16:13:35 -04:00
Daniel Johnson
b0c0e295fc
Hook up the special exception backstops up in LutrisWindow.__init__.
...
It's better not to change state like this just because we *import* lutriswindow.py.
2024-05-19 10:42:53 -04:00
Daniel Johnson
f4d1e1a99f
Raise AuthenticationError from the service load() method if not authenticated.
...
Some services have odd errors that I don't understand, and I've just left those alone for now.
2024-05-19 08:37:40 -04:00
Daniel Johnson
e2d3e6be3a
Add a backstop handler for AuthenticationError that just logs out and logs back in; that's the handling we do on reload, and it should be appropriate for failures at other times.
...
Should help with #5406
2024-05-19 08:30:37 -04:00
Daniel Johnson
1274401c3d
Add the service ID to AuthenticationError.
...
This should allow us to do a relogin in a more general way.
2024-05-19 08:18:28 -04:00
Daniel Johnson
10f7e52cff
Consolidate AuthTokenExpiredError and AuthenticationError.
...
Most uses of AuthenticationError actually say "please log in again" which is the handling for AuthTokenExpiredError- and my read is the few others could generally be addressed that way too.
2024-05-19 08:09:42 -04:00
Daniel Johnson
f8468e120d
Add handling in case the playtime in the config .yml for a game is garbage; this will log and reset the playtime to 0.
...
Resolves #5476
2024-05-14 19:08:45 -04:00
Daniel Johnson
87b18f2fa0
Add exception handling so that if we can't parse the icon from an EXE, we log and continue. It's okay not to have an icon; all the cool kids use banners.
...
Resolves #5475
2024-05-14 19:03:03 -04:00
Daniel Johnson
52fb949ff5
Do a slightly better job of keeping the view up to date when a game is hidden by the user.
2024-05-14 18:58:34 -04:00
Daniel Johnson
655301cf03
Enforce the 'hidden' setting even in the recent items.
...
Resolves #5472
2024-05-14 18:49:25 -04:00
Daniel Johnson
5959768f8a
Add exception handling so a malformed media file does nto crash Lutris, and does not prevent you from setting a new media.
...
Resolves #5474
2024-05-13 04:35:00 -04:00
Daniel Johnson
075b531080
Fix various merge messes
2024-05-12 17:36:06 -07:00
Daniel Johnson
5c32bacf71
Fix some ruff gruffness.
2024-05-12 17:36:06 -07:00
Daniel Johnson
23d18390ee
Fixes for the search tooltip.
2024-05-12 17:36:06 -07:00
Daniel Johnson
b9ddd740d2
Smarter handling of "-"
...
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.
2024-05-12 17:36:06 -07:00
Daniel Johnson
7f5b259419
Fix buggy stop handling; we need to stop before the tag, not before the ':'.
2024-05-12 17:36:06 -07:00
Daniel Johnson
c0b10867ed
Change the special tags to use 'contains' instead of '=='
...
Thus, platform:win finds Windows, and runner:win finds Wine, and so on.
This should be more forgiving for messy carbon based life forms.
2024-05-12 17:36:06 -07:00
Daniel Johnson
4386663709
Expand runner search to search runner human names
2024-05-12 17:36:06 -07:00
Daniel Johnson
5f1c135cdb
Add a "source:" tag that matches service names, and also "service:" as an alias.
2024-05-12 17:36:06 -07:00
Daniel Johnson
acd7f7f07d
Simplify implementation, actually use TRUE_PREDICATE
2024-05-12 17:36:06 -07:00
Daniel Johnson
c529b57a28
Additional commenting
2024-05-12 17:36:06 -07:00
Daniel Johnson
1785a6ecf3
Add a playtime parse that keeps separate parts, use it do an approximate 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!
2024-05-12 17:36:06 -07:00
Daniel Johnson
24b4fe0903
Add a 'lastplayed' search tag.
...
This is treated as a duration, meaning how long ago you last played it. We can expand on this later.
2024-05-12 17:36:06 -07:00
Daniel Johnson
3c3480322a
Add a "directory:" tag for the game search
2024-05-12 17:36:06 -07:00
Daniel Johnson
7d38dd032d
Add tooltips to explain search terms a bit
2024-05-12 17:36:06 -07:00
Daniel Johnson
ce8961fce2
Bug fixes for conjunction handling
2024-05-12 17:36:06 -07:00
Daniel Johnson
7654ac7173
Rework playtime so >= and <= are operators, and so that "playtime:>=3 hours playtime:<=20 hours" will work with no explicit AND.
2024-05-12 17:36:06 -07:00
Daniel Johnson
67f5078079
Rely more heavily on the TokenReader to handle whitespace and conjoined tokens.
...
This way 'playtime: 20 hours' can be parsed, as this tag along can read the rest of the text to the next stop.
2024-05-12 17:36:06 -07:00
Daniel Johnson
dc1a9dfebc
First cut of a playtime search tag - with just >, < and equals matches, 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.
2024-05-12 17:36:06 -07:00
Daniel Johnson
59bdf379e7
Factor out flag handling into a function, and use exceptions rather than None to indicate 'bad tagness'.
...
This way the read_flag_token() function can return None for 'maybe', and raise for 'invalid argument'
2024-05-12 17:36:06 -07:00
Daniel Johnson
c8519f546e
Commenting about the tokenization code; also make it a bit less search-specific.
2024-05-12 17:36:06 -07:00
Daniel Johnson
c43b890982
Move tokenization code into its own module, down in 'lutris.util'.
2024-05-12 17:36:06 -07:00
Daniel Johnson
05e85634c3
Pass the token reader around more so we can have multi-token arguments to the tags
2024-05-12 17:36:06 -07:00
Daniel Johnson
47f452a803
Move away from using iterators, since they proved inadequate.
2024-05-12 17:36:06 -07:00
Daniel Johnson
48210dc7b3
Add support for parenthesis grouping too
2024-05-12 17:36:06 -07:00
Daniel Johnson
11f039aa14
Restore awareness of valid tags, so more ':' characters can be searched for normally
2024-05-12 17:36:06 -07:00
Daniel Johnson
5429cab292
More cleanup using helpful functions
2024-05-12 17:36:06 -07:00
Daniel Johnson
279d49e53b
Replace List[Callable] with SearchPredicate functions for simplicity
2024-05-12 17:36:06 -07:00
Daniel Johnson
070c493265
Clean up recursive descent code via various helper methods.
2024-05-12 17:36:06 -07:00
Daniel Johnson
e1c52b9a92
Add support for the AND conjunction
...
But this is still super messy.
2024-05-12 17:36:06 -07:00
Daniel Johnson
5112d3c60c
Give up on using iterators; add a TokenReader class that can go backwards, allowing lookahead.
2024-05-12 17:36:06 -07:00
Daniel Johnson
3c50d7d208
Rework the parser again, now pre-combining unquoted text runs and handling the OR conjunction
2024-05-12 17:36:06 -07:00
Daniel Johnson
617ec2cbde
Rework the search parser to recursive descent, and also conjoin consecutive text segments so text is order sensitive, and "-alien shooter" applies the negation to the whole thing.
2024-05-12 17:36:06 -07:00
Daniel Johnson
9c4f637f31
More aggressive tokenization; allows forms like "hidden: true" with a space in it.
2024-05-12 17:36:06 -07:00
Daniel Johnson
c20aad4fbb
Extend the search with '-' as a negation operator
2024-05-12 17:36:06 -07:00
Daniel Johnson
c1082ab94a
Replace split with a tokenization function that knows about quotations
2024-05-12 17:36:06 -07:00
Daniel Johnson
e555175d91
Add 'hidden:maybe' support. This is just too cute to resist.
...
'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.
2024-05-12 17:36:06 -07:00
Daniel Johnson
8da7d719e3
Add 'hidden:yes/no' to the search
...
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.
2024-05-12 17:36:06 -07:00
Daniel Johnson
1856e5e466
Add 'favorite:yes/no' to search for favorites.
2024-05-12 17:36:06 -07:00