-
-
Notifications
You must be signed in to change notification settings - Fork 480
[Feature]: Provide Protondb information on game page #2824
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good job. Left some comments. If you don't want to write tests i can do that for you. Whats left is also the frontend. We could do this maybe in a seperated PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one improvement and i have one concern about making the response of protondb api a type. I don't know if axios crashes if the response does not match the type. Can happen if the api response changes.
I want to add the SteamDeck compatibility support fetch and then add the frontend support for both, but I preferred to have both APIs in separate commits since they are mostly separate file paths, and thus separate features. |
Feel free to make more small PR's. Easier for us to review fast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Still left some questions. Let's arrange this in another PR. Will merge this now.
@@ -1,4 +1,4 @@ | |||
import { ProtonDBInfo, ProtonDBCompatibilityInfo } from 'common/types' | |||
import { ProtonDBCompatibilityInfo } from 'common/types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the name ProtonDBCompatibilityInfo
for me ProtonDBInfo
fits much more.
Just my opinion.
@@ -12,7 +12,7 @@ export async function getInfoFromProtonDB( | |||
const url = `https://www.protondb.com/api/v1/reports/summaries/${steamID}.json` | |||
|
|||
const response = await axios | |||
.get<ProtonDBInfo>(url, { headers: {} }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have knowledge about axios with types. My question in the first place was if it crashes if the response does not match the type or if it just ignores not fitting json values? Maybe you have experience here you can share?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just made it non-typed, it's much safer, and it handles a case where the field we want doesn't exist.
Support in getting compatibility information from ProtonDB
Tests pending approval of basic logic.
Use the following Checklist if you have changed something on the Backend or Frontend: