diff --git a/exportModelsJson.js b/exportModelsJson.js index bbd6e74..ae60644 100644 --- a/exportModelsJson.js +++ b/exportModelsJson.js @@ -19,7 +19,7 @@ document.querySelectorAll('.grid.h-10.grid-cols-12.place-content-center.gap-x-3. if (!data.name.endsWith('.bin') && !data.name.endsWith('.pth')) return - data.desc = {en: '', zh: ''} + data.desc = { en: '', zh: '', ja: '' } const rawText = await (await fetch(e.children[1].href.replace('/resolve/', '/raw/'))).text() data.size = parseInt(extractValue(rawText, 'size')) @@ -27,6 +27,7 @@ document.querySelectorAll('.grid.h-10.grid-cols-12.place-content-center.gap-x-3. data.lastUpdated = e.children[3].children[0].getAttribute('datetime') data.url = e.children[1].href.replace('/resolve/', '/blob/') data.downloadUrl = e.children[1].href + data.tags = [] modelsJson.push(data) }) diff --git a/frontend/src/utils/index.tsx b/frontend/src/utils/index.tsx index 250ea7f..452be72 100644 --- a/frontend/src/utils/index.tsx +++ b/frontend/src/utils/index.tsx @@ -90,7 +90,7 @@ export async function refreshLocalModels(cache: { for (let i = 0; i < cache.models.length; i++) { if (!cache.models[i].lastUpdatedMs) cache.models[i].lastUpdatedMs = Date.parse(cache.models[i].lastUpdated); - if (!cache.models[i].tags) + if (!cache.models[i].tags || !Array.isArray(cache.models[i].tags) || cache.models[i].tags?.length === 0) cache.models[i].tags = ['Other']; for (let j = i + 1; j < cache.models.length; j++) {