Refactored media module to generalize avatar and poster storage into photo storage.

This commit is contained in:
2019-12-13 03:28:52 +01:00
parent 20011a74e8
commit 77307d2d13
7 changed files with 183 additions and 142 deletions

View File

@@ -11,39 +11,36 @@ const scrapeRelease = require('./scrape-release');
const { scrapeActors, scrapeBasicActors } = require('./actors');
async function init() {
if (argv.url) {
await Promise.map(argv.url, async url => scrapeRelease(url), {
if (argv.scene) {
await Promise.map(argv.scene, async url => scrapeRelease(url, null, false, false), {
concurrency: 5,
});
knex.destroy();
return;
}
if (argv.movie) {
await Promise.map(argv.movie, async url => scrapeRelease(url, null, false, true), {
concurrency: 5,
});
}
if (argv.scrape || argv.networks || argv.sites) {
await scrapeSites();
knex.destroy();
return;
}
if (argv.actors && argv.actors.length > 0) {
await scrapeActors();
knex.destroy();
return;
}
if (argv.actors) {
await scrapeBasicActors();
knex.destroy();
}
if (argv.server) {
await initServer();
return;
}
await initServer();
knex.destroy();
}
module.exports = init;