mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
Clean up
This commit is contained in:
parent
7fe34a4658
commit
b69a0c2a2e
3 changed files with 1 additions and 28 deletions
|
|
@ -4,16 +4,12 @@ import fs from "fs";
|
|||
import { argv } from "yargs";
|
||||
import fetchInternetArchiveMetadata from "./tasks/fetchInternetArchiveMetadata";
|
||||
import ensureInternetArchiveItemsIndexByMd5 from "./tasks/ensureInternetArchiveItemsIndexByMd5";
|
||||
import migrate from "./tasks/migrate";
|
||||
import logger from "./logger";
|
||||
import DiscordWinstonTransport from "./DiscordWinstonTransport";
|
||||
import * as Skins from "./data/skins";
|
||||
import db from "./db";
|
||||
import Discord from "discord.js";
|
||||
import { tweet } from "./tasks/tweet";
|
||||
import { addSkinFromBuffer } from "./addSkin";
|
||||
import fetch from "node-fetch";
|
||||
import { analyseBuffer, NsfwPrediction } from "./nsfwImage";
|
||||
|
||||
async function main() {
|
||||
const client = new Discord.Client();
|
||||
|
|
@ -35,7 +31,7 @@ async function main() {
|
|||
break;
|
||||
case "metadata": {
|
||||
const hash = argv._[1];
|
||||
console.log(await Skins.getInternetArchiveUrl(hash));
|
||||
console.log(Skins.getInternetArchiveUrl(hash));
|
||||
break;
|
||||
}
|
||||
case "skin": {
|
||||
|
|
@ -68,9 +64,6 @@ async function main() {
|
|||
console.log("Done.");
|
||||
break;
|
||||
}
|
||||
case "migrate": {
|
||||
await migrate();
|
||||
}
|
||||
case "tweet-data": {
|
||||
// From running `tweet.py sort`
|
||||
const file = fs.readFileSync(
|
||||
|
|
@ -98,7 +91,6 @@ async function main() {
|
|||
} finally {
|
||||
logger.close();
|
||||
client.destroy();
|
||||
await db.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
const express = require("express");
|
||||
const app = express();
|
||||
const config = require("./config");
|
||||
const db = require("./db");
|
||||
const iaItems = db.get("internetArchiveItems");
|
||||
// const info = require("/Volumes/Mobile Backup/skins/cache/info.json");
|
||||
const Skins = require("./data/skins");
|
||||
const port = 3001;
|
||||
const fileUpload = require("express-fileupload");
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
const db = require("../db");
|
||||
const iaItems = db.get("internetArchiveItems");
|
||||
const skins = db.get("skins");
|
||||
|
||||
async function main() {
|
||||
const item = await iaItems.findOne({
|
||||
migrated: { $exists: false },
|
||||
md5: { $exists: true },
|
||||
});
|
||||
|
||||
skins.update({ md5: item.md5 });
|
||||
|
||||
console.log(item);
|
||||
}
|
||||
|
||||
export default main;
|
||||
Loading…
Add table
Add a link
Reference in a new issue