Update app metadata to make clockinfo apps easier to find

pull/2717/head^2
Gordon Williams 2023-04-28 09:59:11 +01:00
parent 92a5acdbca
commit 4b2061e899
8 changed files with 13 additions and 8 deletions

View File

@ -9,7 +9,7 @@
"dependencies" : { "clock_info":"module" },
"description": "A watch face that was designed by an AI (stable diffusion) and implemented by a human.",
"type": "clock",
"tags": "clock",
"tags": "clock,clkinfo",
"screenshots": [
{"url":"orig.png"},
{"url":"impl.png"},

View File

@ -6,7 +6,7 @@
"icon": "app.png",
"screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}],
"type": "clock",
"tags": "clock",
"tags": "clock,clkinfo",
"supports" : ["BANGLEJS2"],
"dependencies" : { "clock_info":"module" },
"readme": "README.md",

View File

@ -7,7 +7,7 @@
"icon": "app.png",
"screenshots": [{"url":"screenshot3.png"}],
"type": "clock",
"tags": "clock",
"tags": "clock,clkinfo",
"supports": ["BANGLEJS2"],
"dependencies" : { "clock_info":"module" },
"storage": [

View File

@ -7,7 +7,7 @@
"icon": "app.png",
"screenshots": [{"url":"screenshot.png"}, {"url":"screenshot_2.png"}],
"type": "clock",
"tags": "clock",
"tags": "clock,clkinfo",
"supports": ["BANGLEJS2"],
"dependencies" : { "clock_info":"module" },
"storage": [

View File

@ -5,7 +5,7 @@
"description": "Scheduling library for alarms and timers",
"icon": "app.png",
"type": "scheduler",
"tags": "tool,system,alarm",
"tags": "tool,system,alarm,clkinfo",
"supports": ["BANGLEJS","BANGLEJS2"],
"provides_modules" : ["sched"],
"default" : true,

View File

@ -8,7 +8,7 @@
"icon": "app.png",
"screenshots": [{"url":"screenshot3.png"}],
"type": "clock",
"tags": "clock",
"tags": "clock,clkinfo",
"supports": ["BANGLEJS2"],
"dependencies" : { "clock_info":"module" },
"storage": [

View File

@ -5,7 +5,7 @@
"icon": "app.png",
"screenshots": [{"url":"screenshot.png"}],
"type": "clock",
"tags": "clock",
"tags": "clock,clkinfo",
"supports" : ["BANGLEJS2"],
"dependencies" : { "clock_info":"module" },
"readme": "README.md",

View File

@ -116,7 +116,7 @@ apps.forEach((app,appIdx) => {
if (!app.id) ERROR(`App ${appIdx} has no id`);
var appDirRelative = APPSDIR_RELATIVE+app.id+"/";
var appDir = APPSDIR+app.id+"/";
var metadataFile = appDirRelative+"metadata.json";
var metadataFile = appDirRelative+"metadata.json";
if (existingApps.includes(app.id)) ERROR(`Duplicate app '${app.id}'`, {file:metadataFile});
existingApps.push(app.id);
//console.log(`Checking ${app.id}...`);
@ -124,6 +124,7 @@ apps.forEach((app,appIdx) => {
if (!fs.existsSync(APPSDIR+app.id)) ERROR(`App ${app.id} has no directory`);
if (!app.name) ERROR(`App ${app.id} has no name`, {file:metadataFile});
var isApp = !app.type || app.type=="app";
var appTags = app.tags ? app.tags.split(",") : [];
if (app.name.length>20 && !app.shortName && isApp) ERROR(`App ${app.id} has a long name, but no shortName`, {file:metadataFile});
if (app.type && !METADATA_TYPES.includes(app.type))
ERROR(`App ${app.id} 'type' is one one of `+METADATA_TYPES, {file:metadataFile});
@ -174,6 +175,8 @@ apps.forEach((app,appIdx) => {
if (app.customConnect && !app.custom) ERROR(`App ${app.id} has customConnect but no customn HTML`, {file:metadataFile});
if (app.interface && !fs.existsSync(appDir+app.interface)) ERROR(`App ${app.id} interface HTML doesn't exist`, {file:metadataFile});
if (app.dependencies) {
if (app.dependencies.clock_info && !appTags.includes("clkinfo"))
WARN(`App ${app.id} uses clock_info but doesn't have clkinfo tag`, {file:metadataFile});
if (("object"==typeof app.dependencies) && !Array.isArray(app.dependencies)) {
Object.keys(app.dependencies).forEach(dependency => {
if (!["type","app","module","widget"].includes(app.dependencies[dependency]))
@ -185,6 +188,8 @@ apps.forEach((app,appIdx) => {
ERROR(`App ${app.id} 'dependencies' must be an object`, {file:metadataFile});
}
if (app.storage.find(f=>f.name.endsWith(".clkinfo.js")) && !appTags.includes("clkinfo"))
WARN(`App ${app.id} provides ...clkinfo.js but doesn't have clkinfo tag`, {file:metadataFile});
var fileNames = [];
app.storage.forEach((file) => {
if (!file.name) ERROR(`App ${app.id} has a file with no name`, {file:metadataFile});