-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat implement subjects cache #8
Conversation
I've added the comments for the important parts so it's easier to review. The most important file for review is the You can pretty much ignore everything else, as this is the only new thing and others are just some small implementations of this :) |
I am afraid that's far beyond my coding capabilities. I can mostly undestand what the code does but it is not enough to find mistakes. Honestly i have never looked up python syntax yet. |
That's okay :D I've tested it, and it works well (or at least I hope so :P) so it's only if you find some obvious mistakes. Don't worry if you can't fully read it, that's only a sign of the fact that it's not coded well, I would be glad if you could point those parts out :) |
I would also add the url (for example: https://gymkh.bakalari.cz) to the .env for easier modification. That's fast change. |
Yeah, I will add that outside of this PR to keep the history clean. Will push it to |
|
Thanks for looking into it 🙏 I've pushed the fix for the hard-coded bakalari URL to |
Implements a subject names cache that stores subjects extracted from grades and schedules.
This resolves the need to have the subjects hard-coded as constants. They are now automatically extracted from schedules and grades and are stored into a cache.
Hi @Vojtak42, if you have time and will, would please look at this PR? It's pretty big, so it's pretty hard for a review, but I will comment out the most important changes :) Many thanks!
I can't currently add you as a reviewer since you are not a collaborator in this repo. I have sent you an invite ;)
Context:
Ideally we would only extract this from the schedule then, but an edge case where there would be a grade for a subject that was not yet seen in the schedule would break it. So we have to scrape it from both places.
If a short name cannot be scraped, the full name is used as a fallback.