traxxx/src/app.js

41 lines
851 B
JavaScript
Raw Normal View History

'use strict';
const argv = require('./argv');
const knex = require('./knex');
const initServer = require('./web/server');
const scrapeSites = require('./scrape-sites');
2020-01-02 23:59:02 +00:00
const { scrapeReleases } = require('./scrape-releases');
const { scrapeActors, scrapeBasicActors } = require('./actors');
async function init() {
if (argv.scene) {
2020-01-02 23:59:02 +00:00
await scrapeReleases(argv.scene, null, 'scene');
}
if (argv.movie) {
2020-01-02 23:59:02 +00:00
await scrapeReleases(argv.movie, null, 'movie');
}
if (argv.scrape || argv.networks || argv.sites) {
await scrapeSites();
}
if (argv.actors && argv.actors.length > 0) {
2019-11-17 02:56:45 +00:00
await scrapeActors();
}
if (argv.actors) {
await scrapeBasicActors();
}
if (argv.server) {
await initServer();
return;
}
knex.destroy();
}
2019-12-09 04:00:49 +00:00
module.exports = init;