Beebeeoii / lominus

NUS Canvas file sync
MIT License
60 stars 7 forks source link

Luminus files not being downloaded #80

Closed Beebeeoii closed 1 year ago

Beebeeoii commented 2 years ago

Describe the bug Some Luminus modules like CS2105 have files uploaded but Lominus does not seem to download those files. The file structure of those modules' files is nested. For example, lecture pdf files in a folder called Lecture.

Expected behavior Files to be downloaded.

Screenshots File Structure; image

image

Desktop (please complete the following information):

Additional context This is a very interesting and unique report by someone and the issue seems to only affect a very small subset of modules available on Luminus. As such, it is quite hard to debug and much more information is required to identify the root cause of the issue.

ghost commented 2 years ago

EE2211, EE3408C and ES2631 on Luminus aren't being synced on my end either. EE3408C has a similar folder structure to CS2105 in the screenshot while EE2211 and ES2631 have their files at least two folders deep. It would be a lot more helpful for debugging if the app printed the actions it's currently executing and any errors it encounters into some kind of console. I'm not looking too hard at the code, but it seems like the app is doing this:

It authenticates through the Canvas and Luminus APIs, retrieves the list of modules, retrieves the folder structure of a module, retrieves the names of the files in said folder, sends a download request for each file through the API if a file with the same name doesn't exist in the target location, then iterates through the remaining folders and modules in the list. I've tested the "Retrieving Modules" API example and it returns all of the modules in a certain fixed order, so I suspect the issue is either that the folder structures and file names aren't being retrieved correctly, or that Luminus' API starts throwing out 403/429s after a certain amount of requests and canceling the entire process.

Beebeeoii commented 1 year ago

closing issue as Luminus is obsolete from AY22/23 Sem 2 onwards