mcndt / obsidian-toggl-integration

A Toggl integration plugin for the popular knowledge base application Obsidian.
GNU General Public License v3.0
267 stars 19 forks source link

Exclude Tags not filtering out time entries #129

Closed dljsjr closed 11 months ago

dljsjr commented 1 year ago

I'm using Toggl Track to track where my time is spent at my desk job, and one of the things I would like to be able to do is visualize, comparatively, my planned work vs interrupt based work via tags.

INCLUDE TAGS seems to be working; if I INCLUDE TAGS #unplanned then I only get tagged entries. But if I use EXCLUDE TAGS #unplanned on another query, it doesn't actually exclude those entries.

The real life, not redacted query from my Vault is actually pretty straight forward:

```toggl
SUMMARY
WEEK
INCLUDE CLIENTS "Work"
EXCLUDE TAGS #unplanned
TITLE "Planned Work"
```

Thanks for the awesome plugin!

EDIT: Screenshot image

mayukhc commented 11 months ago

Same issue, include working whereas exclude not working for both projects and tags. Love the plugin, hope there's a fix.

mcndt commented 11 months ago

I think I see the problem in the code, will have a look.

mcndt commented 11 months ago

Turns out the Toggl API only supports including tags and not excluding tags. For the list view I am able to work around this by filtering the results locally, but for the summary report the API only returns me the totals per project and per day, so I can only filter by included tags here.

I will make the plugin throw a parsing error when generating summary reports with excluded tags in the upcoming 0.11.0 release.

mayukhc commented 11 months ago

Ok, thanks for checking. Is excluding projects in summary views supported by the API? Below query is working in list view, not in summary. Plugin version is 0.10.0.

SUMMARY
FROM 2023-07-14 TO TODAY
EXCLUDE PROJECTS "Waste", "Routine"
SORT DESC
mcndt commented 11 months ago

It should be possible, can you make a new issue for this?