41 lines
851 B
JavaScript
41 lines
851 B
JavaScript
'use strict';
|
|
|
|
const argv = require('./argv');
|
|
const knex = require('./knex');
|
|
const initServer = require('./web/server');
|
|
|
|
const scrapeSites = require('./scrape-sites');
|
|
const { scrapeReleases } = require('./scrape-releases');
|
|
const { scrapeActors, scrapeBasicActors } = require('./actors');
|
|
|
|
async function init() {
|
|
if (argv.scene) {
|
|
await scrapeReleases(argv.scene, null, 'scene');
|
|
}
|
|
|
|
if (argv.movie) {
|
|
await scrapeReleases(argv.movie, null, 'movie');
|
|
}
|
|
|
|
if (argv.scrape || argv.networks || argv.sites) {
|
|
await scrapeSites();
|
|
}
|
|
|
|
if (argv.actors && argv.actors.length > 0) {
|
|
await scrapeActors();
|
|
}
|
|
|
|
if (argv.actors) {
|
|
await scrapeBasicActors();
|
|
}
|
|
|
|
if (argv.server) {
|
|
await initServer();
|
|
return;
|
|
}
|
|
|
|
knex.destroy();
|
|
}
|
|
|
|
module.exports = init;
|