Skip to content

Commit 6810e67

Browse files
committed
fix: alltime
1 parent 3b2278a commit 6810e67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/plugins/wakatime/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
2424

2525
//Querying api and format result (https://wakatime.com/developers#stats)
2626
console.debug(`metrics/compute/${login}/plugins > wakatime > querying api`)
27-
const {data: {text: total_time}} = await imports.axios.get(`${url}/api/v1/users/${user}/all_time_since_today?api_key=${token}`)
27+
const {data: {data: alltime}} = await imports.axios.get(`${url}/api/v1/users/${user}/all_time_since_today?api_key=${token}`)
2828
const {data: {data: stats}} = await imports.axios.get(`${url}/api/v1/users/${user}/stats/${range}?api_key=${token}`)
2929

3030
const projectStats = stats.projects?.map(({name, percent, total_seconds: total}) => ({name, percent: percent / 100, total})).sort((a, b) => b.percent - a.percent)
@@ -37,7 +37,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
3737
time: {
3838
total: (others ? stats.total_seconds_including_other_language : stats.total_seconds) / (60 * 60),
3939
daily: (others ? stats.daily_average_including_other_language : stats.daily_average) / (60 * 60),
40-
globaltotal: total_time
40+
globaltotal: alltime.text
4141
},
4242
languages: stats.languages?.map(({name, percent, total_seconds: total}) => ({name, percent: percent / 100, total})).filter(({name}) => imports.filters.text(name, _ignored)).sort((a, b) => b.percent - a.percent).slice(0, limit),
4343
os: stats.operating_systems?.map(({name, percent, total_seconds: total}) => ({name, percent: percent / 100, total})).sort((a, b) => b.percent - a.percent).slice(0, limit),

0 commit comments

Comments
 (0)