Performance: prepare dropping the NSI-logos from the repo

This commit is contained in:
Pieter Vander Vennet 2025-04-27 02:57:12 +02:00
parent 164b02c8ff
commit 555075edfe
3 changed files with 17 additions and 26 deletions

View file

@ -42,7 +42,7 @@ class NsiLogos extends Script {
let path = basePath + nsiItem.id
const logos = nsiWD["wikidata"][nsiItem?.tags?.[type + ":wikidata"]]?.logos
const nsi = await NameSuggestionIndex.getNsiIndex()
const nsi = await NameSuggestionIndex.getNsiIndex("./assets/data/nsi/")
if (nsi.isSvg(nsiItem, type)) {
path = path + ".svg"
}
@ -104,7 +104,7 @@ class NsiLogos extends Script {
* @param type
*/
async downloadFor(type: string): Promise<{ downloadCount: number; errored: number }> {
const nsi = await NameSuggestionIndex.getNsiIndex()
const nsi = await NameSuggestionIndex.getNsiIndex("./assets/data/nsi/")
const items = nsi.allPossible(type)
const basePath = "./public/assets/data/nsi/logos/"
let downloadCount = 0
@ -158,7 +158,7 @@ class NsiLogos extends Script {
}
private async generateRendering(type: string) {
const nsi = await NameSuggestionIndex.getNsiIndex()
const nsi = await NameSuggestionIndex.getNsiIndex("./assets/data/nsi/")
const items = nsi.allPossible(type)
const filterOptions: FilterConfigOptionJson[] = items.map((item) => {
return {
@ -278,7 +278,7 @@ class NsiLogos extends Script {
* @private
*/
private static async prune() {
const nsi = await NameSuggestionIndex.getNsiIndex()
const nsi = await NameSuggestionIndex.getNsiIndex("./assets/data/nsi/")
const types = nsi.supportedTypes()
const ids = new Set<string>()
for (const t of types) {