[scraper] assigns subtitle indexes directly to file table as json array

This commit is contained in:
TheBeastLT
2020-05-04 21:46:39 +02:00
parent 46b75f0466
commit d47cf4304e
4 changed files with 71 additions and 88 deletions

View File

@@ -1,5 +1,6 @@
const { parse } = require('parse-torrent-title');
const { Type } = require('./types');
const Promises = require('./promises');
const repository = require('./repository');
const { getImdbId, getKitsuId } = require('./metadata');
const { parseTorrentFiles } = require('./torrentFiles');
@@ -47,7 +48,7 @@ async function createTorrentEntry(torrent, overwrite = false) {
}
return repository.createTorrent({ ...torrent, contents, subtitles })
.then(() => Promise.all(videos.map(video => repository.createFile(video))))
.then(() => Promises.sequence(videos.map(video => () => repository.createFile(video))))
.then(() => console.log(`Created ${torrent.provider} entry for [${torrent.infoHash}] ${torrent.title}`));
}