scottquach / Canvas-Assignments-Transfer-For-Todoist

Transfer your school assignments from Canvas to Todoist
MIT License
41 stars 19 forks source link

Running in background #49

Closed calejvaldez closed 3 months ago

calejvaldez commented 6 months ago

Summary

This PR creates this new feature: A "run in background" feature, asking users if they want to make the program auto-update every ~1 hour

Purpose

I like knowing that my assignments will stay updated without me having to manually run a script, so having the script run in the background while I'm in class sounds much better.

Acknowledgements

Thanks to the developers of the original script! I actually hope to use this a lot to stay on top of my assignments.

calejvaldez commented 6 months ago

I don't think the cache assignments thing is a good idea anymore, should probably focus on "is past due" or "is marked as completed" using the Canvas API.

My issue at the moment is that I get a lot of assignments that are past due that keep appearing on my Todoist, even if I mark them as completed. I think having this as an option wouldn't hurt anymore.

Anyways, the "background run" thing seems to be ready.

stacksjb commented 6 months ago

Thanks for the comments and updates! A couple thoughts:

1) Running every hour is a surefire way to possibly get throttled/locked by both Todoist and/or Canvas APIs. Todoist is nicer - they just reject your requests. Canvas in particular is really picky and will just block the API key, and it will quit working. Are your teachers really adding assignments within an hour timeframe? The goal here is to pull all of your assignments from Canvas into Todoist, not keep the two in sync.

2) Currently tasks aren't filtered from the Canvas API - that's something I'm considering reworking in the future probably with a substantial rewrite - but right now all of them are pulled and synced. This is helpful for the completion stats but not entirely necessary.

calejvaldez commented 6 months ago

Hi, I agree with every hour being excessive. I've had p bad experiences with some professors changing things last minute. I was considering maybe just once a day or something, so maybe I should change that instead. :P

As for filtering... yeah I saw the Canvas API and saw how weird it's looking. 😔

stacksjb commented 6 months ago

Regarding your assignment on past due assignments - can they be submitted? The way I have the logic currently is to copy anything that can be submitted. My expectation was that if you can submit it, you would want it synced..

stacksjb commented 6 months ago

Daily, or even every 8-12 hours, is certainly reasonable. It does depend on your courses and the amount of content. When I ran this with 6-8 courses, I got throttled pretty quick, running more than even hourly was too much (improved since we fixed it a bit). If you only had say 1-2 courses with <100 assignments total, you could probably run it infinitely.

calejvaldez commented 6 months ago

Regarding your assignment on past due assignments - can they be submitted? The way I have the logic currently is to copy anything that can be submitted. My expectation was that if you can submit it, you would want it synced..

That makes sense tbh. Some professors are a bit weird with it. Like, discussions that are done in groups but the submission isn't a group submission?

I suppose it isn't an issue with the code, but rather user issue error lol

calejvaldez commented 6 months ago

Also, if there's anything else I can do, please let me know. I'll try to finish it up any changes tomorrow. :)