ref(plugins): centralize skip and ignore filters (#1238)

This commit is contained in:
Simon Lecoq
2022-09-21 23:50:18 -04:00
committed by GitHub
parent b0244de50e
commit 8523db79cb
13 changed files with 106 additions and 71 deletions

View File

@@ -23,7 +23,7 @@ export default async function({login, q, imports, data, computed, graphql, queri
const achievements = list
.filter(a => (order[a.rank] >= order[threshold]) || ((a.rank === "$") && (secrets)))
.filter(a => (!only.length) || ((only.length) && (only.includes(a.title.toLocaleLowerCase()))))
.filter(a => !ignored.includes(a.title.toLocaleLowerCase()))
.filter(a => imports.filters.text(a.title, ignored))
.sort((a, b) => (order[b.rank] + b.progress * 0.99) - (order[a.rank] + a.progress * 0.99))
.map(({title, unlock, ...achievement}) => ({
prefix: ({S: "Master", A: "Super", B: "Great"}[achievement.rank] ?? ""),