-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix hall of fame images #105
Conversation
…-white-background Fix subtabs white textcolor on white background
…x-hall-of-fame-images # Conflicts: # lib/scraping/formula_one.dart
Thanks for the PR! The code is a lot more cleaner that what I have done... (I'm not proud of it though)
I know that it is a bit confusing, but I created the server to support the web version (mostly). So, when using a boxbox server, the API url has to be changed, but also the main website url, as it is blocked by the CORS too. So when the server is changed (e.g., the endpoint here), the main website url is changed too. |
lib/scraping/formula_one.dart
Outdated
String driverName = driverInfo[0]; | ||
String driverYears = driverInfo[1]; | ||
|
||
dom.Element imageElement = element.getElementsByTagName('img').firstWhere((e) => e.classes.contains('hidden')); |
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.
Can you add a trailing comma and then run a dart format . --set-exit-if-changed
to format the code?
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 get the trailing icon here. I did applied the formatter, I was thinking of adding it to a workflow to fix this on the fly.
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 get the trailing icon here. I did applied the formatter, I was thinking of adding it to a workflow to fix this on the fly.
Yes, no worries. I will do a proper workflow for the PRs with formatting and analysing .
Ah that does make sense, only the endpoint variable set now is never used so always different. I can refactor the rest of the class if you want me too. |
You can if you want to, but I think that a rewrite would be more appropriate when a function breaks, like this one. I'm not sure if it is a really good way to do, but at least it is easier. |
I kind of rewrote the logic to be more generic and account for changes on formula1 side, as long as they don't change the html.
I was a bit confused about the endpoint check because the one from Hive is never the same as the one set hardcoded in formula_one.dart, because the default values differ. I left it the same for now.