const db = require("./utils/db")

;(async () => {
	if (process.argv.length < 2) {
		console.error("Needs at least one argument.")
		process.exit(1)
	}

	// node add-takedown.js video id [organization] [url]
	// node add-takedown.js channel id [organization] [url]

	let args
	switch(process.argv[2]) {
		case "video":
			args = { id: process.argv[3], org: process.argv[4], url: process.argv[5] }
			db.prepare("INSERT INTO TakedownVideos (id, org, url) VALUES (@id, @org, @url)").run(args)
			break;

		case "channel":
			args = { ucid: process.argv[3], org: process.argv[4], url: process.argv[5] }
			db.prepare("INSERT INTO TakedownChannels (ucid, org, url) VALUES (@ucid, @org, @url)").run(args)
			break;
	}
})()
