Compare commits

...

2 Commits

Author SHA1 Message Date
Niels Simenon 761078bf19 1.23.1 2022-11-17 22:05:08 +01:00
Niels Simenon a13d88ada5 Fixed Kuwait geo image. 2022-11-17 22:05:05 +01:00
6 changed files with 13 additions and 10 deletions

View File

@ -571,16 +571,18 @@
"alpha2": "KP",
"name": "North Korea"
},
{
"file": "e7d0.png",
"code": "KQ"
},
{
"file": "38dd.png",
"code": 410,
"alpha2": "KR",
"name": "South Korea"
},
{
"file": "cd37.png",
"code": 414,
"alpha2": "KW",
"name": "Kuwait"
},
{
"file": "4ace.png",
"code": 398,

View File

@ -35,10 +35,11 @@ async function init() {
const countryImgs = await fs.readdir(`./assets/${type}`);
const countriesByCode = Object.fromEntries(data[type].map((country) => [country.alpha2, country]));
const imgCountries = await Promise.all(countryImgs.map(async (file) => {
const imgCountries = await Promise.all(countryImgs.filter((file) => !['encoded', 'disabled'].includes(file)).map(async (file) => {
const code = file.match(/(\w+).png/)?.[1];
if (!code || !countriesByCode[code]) {
console.warn(`No country for ${file} with code ${code}`);
return null;
}
@ -51,9 +52,9 @@ async function init() {
code,
...countriesByCode[code],
};
}).filter(Boolean));
}));
await fs.writeFile(`./assets/${type}-curated.json`, JSON.stringify(imgCountries, null, 4));
await fs.writeFile(`./assets/${type}-curated.json`, JSON.stringify(imgCountries.filter(Boolean), null, 4));
console.log('Done!');
}

View File

Before

Width:  |  Height:  |  Size: 341 KiB

After

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.23.0",
"version": "1.23.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.23.0",
"version": "1.23.1",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.23.0",
"version": "1.23.1",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {