Add linter and minor bug fixes (#107)

This commit is contained in:
Simon Lecoq
2021-02-05 23:45:48 +01:00
committed by GitHub
parent 61e2f6e1a1
commit 882a93dea5
74 changed files with 1544 additions and 712 deletions

View File

@@ -22,12 +22,12 @@
<div class="tracklist">
<% for (const {name = "", artist = "", artwork = "", played_at = ""} of plugins.music.tracks) { %>
<div class="track">
<img src="data:image/png;base64,<%= artwork %>" width="<%= !!played_at.length ? 48 : 32 %>" height="<%= !!played_at.length ? 48 : 32 %>" alt=""/>
<img src="data:image/png;base64,<%= artwork %>" width="<%= plugins.music.played_at ? 48 : 32 %>" height="<%= plugins.music.played_at ? 48 : 32 %>" alt=""/>
<div class="infos">
<div class="name"><b><%= name %><b></div>
<div class="name"><%= name %></div>
<div class="artist"><%= artist %></div>
<% if (played_at.length) { %>
<div class="played_at"><%= played_at %></div>
<% if (plugins.music.played_at) { %>
<div class="played-at"><%= played_at %></div>
<% } %>
</div>
</div>

View File

@@ -272,8 +272,9 @@
.track .name {
font-size: 14px;
line-height: 14px;
font-weight: 600;
}
.track .artist {
.track .artist, .track .played-at {
font-size: 12px;
color: #666666;
}

View File

@@ -1,5 +1,5 @@
/** Template processor */
export default async function ({login, q}, {conf, data, rest, graphql, plugins, queries}, {s, pending, imports}) {
/**Template processor */
export default async function(_, __, {imports}) {
//Core
await imports.plugins.core(...arguments)
}
}

View File

@@ -1,11 +1,11 @@
/** Template processor */
export default async function ({login, q}, {conf, data, rest, graphql, plugins, queries, account}, {s, pending, imports}) {
/**Template processor */
export default async function({login, q}, {data, rest, graphql, queries, account}, {pending, imports}) {
//Check arguments
const {repo} = q
if (!repo) {
console.debug(`metrics/compute/${login}/${repo} > error, repo was undefined`)
data.errors.push({error:{message:`You must pass a "repo" argument to use this template`}})
return await imports.plugins.core(...arguments)
data.errors.push({error:{message:"You must pass a \"repo\" argument to use this template"}})
return imports.plugins.core(...arguments)
}
console.debug(`metrics/compute/${login}/${repo} > switching to mode ${account}`)
@@ -73,4 +73,4 @@
//Reformat projects names
if (data.plugins.projects)
data.plugins.projects.list?.map(project => project.name = project.name.replace(`(${login}/${repo})`, "").trim())
}
}

View File

@@ -1,7 +1,7 @@
/** Template processor */
export default async function ({login, q}, {conf, data, rest, graphql, plugins, queries}, {s, pending, imports}) {
/**Template processor */
export default async function({q}, _, {imports}) {
//Core
await imports.plugins.core(...arguments)
//Disable optimization to keep white-spaces
q.raw = true
}
}