Skip to content

Commit

Permalink
fix: Improve some implicit playtime filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
colin969 committed Mar 21, 2024
1 parent fbf1ed5 commit 54d4255
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@fortawesome/react-fontawesome": "0.1.18",
"@fparchive/flashpoint-archive": "0.7.4",
"@fparchive/flashpoint-archive": "0.7.5",
"@types/react-virtualized": "^9.21.21",
"axios": "1.6.7",
"connected-react-router": "6.9.2",
Expand Down
4 changes: 2 additions & 2 deletions src/back/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2499,14 +2499,14 @@ function adjustGameFilter(state: BackState, query: ViewQuery, search: GameSearch
search.order.column = GameSearchSortable.RELEASEDATE;
break;
case 'lastPlayed':
if (!search.filter.higherThan.playtime && search.filter.equalTo.playcount === undefined && !query.playlistId) {
if (!search.filter.higherThan.playcount && search.filter.equalTo.playcount === undefined && search.filter.equalTo.playtime === undefined && !query.playlistId) {
// When searching outside a playlist, treat playtime sorting like a history
search.filter.higherThan.playcount = 0;
}
search.order.column = GameSearchSortable.LASTPLAYED;
break;
case 'playtime':
if (!search.filter.higherThan.playcount && search.filter.equalTo.playcount === undefined && !query.playlistId) {
if (!search.filter.higherThan.playcount && search.filter.equalTo.playcount === undefined && search.filter.equalTo.playtime === undefined && !query.playlistId) {
// When searching outside a playlist, treat playtime sorting like a history
search.filter.higherThan.playcount = 0;
}
Expand Down

0 comments on commit 54d4255

Please sign in to comment.