dwaring87 / rtm-cli

Remember the Milk Command Line Interface
MIT License
66 stars 14 forks source link

Surgically gets Task Series for use in the url command #23

Closed beauraines closed 2 years ago

beauraines commented 2 years ago

Uses the local task index to build a more surgical request for getting task series with tasks

Fixes #21 where the url command would hang because it was requesting a HUGE number of tasks.

beauraines commented 2 years ago

After sleeping on this, I'm not proud of this PR. There is more I can do to make this reusable and more clear in what it's doing.

While the idea is still sound (get a task or task series by it's index) the implementation can be cleaned up..

I'll close this and make a new one when its ready.

beauraines commented 2 years ago

Reopening. I realized that this is good as it is. The code needs to be written this way as it is leveraging the callback functions. I'm not quite good enough to abstract the get tasks by index because it would need to use promises rather than callbacks and I think that would cascade down into rtm-api too.

dwaring87 commented 2 years ago

Similarly to #25, I updated the url command to use the hasUrl:true filter in the user.tasks.getTask function to reduce the number of tasks fetched from the API when trying to get the requested task.