Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support durations API #500

Open
shyim opened this issue Jul 2, 2023 · 2 comments
Open

Support durations API #500

shyim opened this issue Jul 2, 2023 · 2 comments
Labels
effort:3 enhancement New feature or request prio c

Comments

@shyim
Copy link
Contributor

shyim commented Jul 2, 2023

Hey,

I want to get a Streamlabs Plugin to run, but it seems like the Duration API is not supported right now.

Client code to call

@muety
Copy link
Owner

muety commented Jul 2, 2023

Hi @shyim, thanks for bringing this up! Supporting the durations API would definitely improve compatibility between Wakapi and WakaTime.

I'll keep this open as a feature request, but, realistically, this won't be implemented any time too soon. Implementing the API itself would be quite straightforward, but durations in Wakapi work a bit differently than in WakaTime, which we would have to account for.

Also, the concept of durations is a somewhat internal thing anyways. A user shouldn't ever have to deal with "raw" durations, but would rather be interested in summarized statistics.

I looked into the plugin's code, and it seems like the only purpose for using the durations endpoint is to fetch today's total coding time - without any need for the actual level of granularity that the endpoint provides. So my suggestion would be to open a PR with the plugin where the durations endpoint gets replaced by the stats endpoint. This would not only make the plugin compatible with Wakapi, but also improve efficiency, because it wouldn't have to download a whole batch of duration objects just to get a single number (total time) in the end.

Hope that helps!

@GioPan04
Copy link
Contributor

GioPan04 commented Nov 27, 2023

Hi, this endpoint could be really useful. It can be used by clients to show what a user worked on the day, the pauses it took, etc.

A user shouldn't ever have to deal with "raw" durations, but would rather be interested in summarized statistics.

I wouldn't say that this is raw data, the funny thing is that heartbeats (which are literally the raw data) is exposed via the API, but durations are not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:3 enhancement New feature or request prio c
Projects
None yet
Development

No branches or pull requests

3 participants