feat(plugins/wakatime): add plugin_wakatime_languages_ignored (#1082) [skip ci]
This commit is contained in:
@@ -7,7 +7,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
return null
|
||||
|
||||
//Load inputs
|
||||
let {sections, days, limit, url, user, "languages.other": others, "repositories.visibility": repositoriesVisibility} = imports.metadata.plugins.wakatime.inputs({data, account, q})
|
||||
let {sections, days, limit, url, user, "languages.other": others, "languages.ignored":_ignored, "repositories.visibility": repositoriesVisibility} = imports.metadata.plugins.wakatime.inputs({data, account, q})
|
||||
|
||||
if (!limit)
|
||||
limit = void limit
|
||||
@@ -36,7 +36,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
total: (others ? stats.total_seconds_including_other_language : stats.total_seconds) / (60 * 60),
|
||||
daily: (others ? stats.daily_average_including_other_language : stats.daily_average) / (60 * 60),
|
||||
},
|
||||
languages: stats.languages?.map(({name, percent, total_seconds: total}) => ({name, percent: percent / 100, total})).sort((a, b) => b.percent - a.percent).slice(0, limit),
|
||||
languages: stats.languages?.map(({name, percent, total_seconds: total}) => ({name, percent: percent / 100, total})).filter(({name}) => _ignored.length ? !_ignored.includes(name.toLocaleLowerCase()) : true).sort((a, b) => b.percent - a.percent).slice(0, limit),
|
||||
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),
|
||||
editors: stats.editors?.map(({name, percent, total_seconds: total}) => ({name, percent: percent / 100, total})).sort((a, b) => b.percent - a.percent).slice(0, limit),
|
||||
}
|
||||
|
||||
@@ -80,6 +80,13 @@ inputs:
|
||||
type: boolean
|
||||
default: no
|
||||
|
||||
plugin_wakatime_languages_ignored:
|
||||
description: Ignored languages
|
||||
type: array
|
||||
format: comma-separated
|
||||
default: ""
|
||||
example: html, css, ...
|
||||
|
||||
plugin_wakatime_repositories_visibility:
|
||||
description: |
|
||||
Repositories visibility
|
||||
|
||||
Reference in New Issue
Block a user