You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.
I'm currently using this library for a simple python-script that displays the amount of accomplished vs scheduled tasks for the current day in my desktop's status-bar.
I decided to filter completed tasks using the CompletedManager.get_all() and filter for the current day to ensure that recurring tasks are counted as well (when loading items for $day, date_completed might not be set if the item is recurring).
Unfortunately the CompletedManager directly calls the REST API and doesn't try to use the local cache first which breaks the script in case of no or weak connectivity. I actually wanted to implement this yesterday, but realized that I'm unsure what's the best approach here. I had the following ideas:
Introduce a new object-type completed-item (using the Item-model) which is synced after the /sync call to the API (AFAICS the sync doesn't list completed-tasks on its own or did I miss something?)
Cons: a lot of duplicates (all completed tasks are actually cached already) in the cache
Fill self.state of CompletedManager with items from the cache that were completed.
Con(?): last time I tried something like this, I didn't manager to detect completed recurring items.
As I'm pretty new to the codebase, I don't feel qualified to decide what's best (maybe even something totally different 😇 ).
Thus I'd be fairly happy about getting some feedback here, then I'd be willing to file a patch :)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm currently using this library for a simple python-script that displays the amount of accomplished vs scheduled tasks for the current day in my desktop's status-bar.
I decided to filter completed tasks using the
CompletedManager.get_all()
and filter for the current day to ensure that recurring tasks are counted as well (when loading items for $day,date_completed
might not be set if the item is recurring).Unfortunately the
CompletedManager
directly calls the REST API and doesn't try to use the local cache first which breaks the script in case of no or weak connectivity. I actually wanted to implement this yesterday, but realized that I'm unsure what's the best approach here. I had the following ideas:Introduce a new object-type
completed-item
(using theItem
-model) which is synced after the/sync
call to the API (AFAICS the sync doesn't listcompleted
-tasks on its own or did I miss something?)Fill
self.state
ofCompletedManager
withitems
from the cache that were completed.As I'm pretty new to the codebase, I don't feel qualified to decide what's best (maybe even something totally different 😇 ).
Thus I'd be fairly happy about getting some feedback here, then I'd be willing to file a patch :)
The text was updated successfully, but these errors were encountered: