mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
Small improvements
This commit is contained in:
parent
333e85ae23
commit
3d8876f771
3 changed files with 11 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ const findTweetableSkin = require("./tasks/findTweetableSkins");
|
|||
const fetchInternetArchiveMetadata = require("./tasks/fetchInternetArchiveMetadata");
|
||||
const path = require("path");
|
||||
const Skins = require("./data/skins");
|
||||
const db = require("./db");
|
||||
|
||||
const { spawn } = require("child_process");
|
||||
|
||||
|
|
@ -68,6 +69,7 @@ async function main() {
|
|||
default:
|
||||
console.log(`Unknown command ${argv._[0]}`);
|
||||
}
|
||||
// await db.close();
|
||||
}
|
||||
|
||||
main();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ async function postSkin({ md5, title, dest }) {
|
|||
.setImage(screenshotUrl);
|
||||
|
||||
if (readmeText) {
|
||||
embed.setDescription(`\`\`\`${readmeText}\`\`\``);
|
||||
// Trim the readme since Discord will reject it otherwise.
|
||||
embed.setDescription(`\`\`\`${readmeText.slice(0, 2000)}\`\`\``);
|
||||
}
|
||||
if (averageColor) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -22,11 +22,13 @@ async function fetchAllMetadata(limit) {
|
|||
},
|
||||
}
|
||||
);
|
||||
console.log(`Found ${items.length} missing metadata`);
|
||||
await Promise.all(
|
||||
items.map(item => {
|
||||
return fetchMetadata(item.identifier);
|
||||
})
|
||||
);
|
||||
return items.length;
|
||||
}
|
||||
// TODO: Refetch collections from:
|
||||
// https://archive.org/advancedsearch.php?q=collection%3Awinampskins&fl%5B%5D=identifier&rows=100000&page=1&output=json
|
||||
|
|
@ -36,7 +38,11 @@ module.exports = async function main() {
|
|||
async function go() {
|
||||
console.log("Gonna fetch some more");
|
||||
try {
|
||||
await fetchAllMetadata(500);
|
||||
const count = await fetchAllMetadata(500);
|
||||
if(count < 1) {
|
||||
console.log("Done.");
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
delay += 60000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue