aarctan / schedubuddy-server

https://schedubuddy.com/
MIT License
4 stars 1 forks source link

ft: fixup time parsing #15

Closed Mattwmaster58 closed 1 year ago

Mattwmaster58 commented 1 year ago

i looked at the time parsing code and said "wow i could do better". then I wrote this. it is the product of generalizing everything. that massive regex is probably not the right way to go about things, but this code does fix #14. Should work on existing JSON dumps. Previously, 33% of courses were getting "thrown out" and now that's down to...28% (see the SQL in #14).

I changed the code so we don't have to throw anything out actually, only classes that we parse scheduled times for do we add to in the first place, so theres no orphaned classes/coures to remove like before. Also added some guards as warning signs when date parsing goes wrong (checking if the current year as a string is in any of the embeds)

aarctan commented 1 year ago

Can you run write_raw and then commit the new json and .db with your changes? So we can merge with the fixes to as well