Not creating batch ID when no movies are to be stored.

This commit is contained in:
DebaucheryLibrarian 2020-08-23 03:41:29 +02:00
parent fe5daefd61
commit d8b8dfa299
1 changed files with 4 additions and 0 deletions

View File

@ -357,6 +357,10 @@ async function associateMovieScenes(movies, movieScenes) {
}
async function storeMovies(movies, movieScenes) {
if (movies.length === 0) {
return [];
}
const { uniqueReleases } = await filterDuplicateReleases(movies);
const [batchId] = await knex('batches').insert({ comment: null }).returning('id');