import { JobQueue } from '../job-queue'
import { Notifier } from '../notifier'
import { createPlaceholderThumbnail, createVideoMiniatureFromUrl } from '../thumbnail'
+import { setVideoTags } from '../video'
import { autoBlacklistVideoIfNeeded } from '../video-blacklist'
import { getOrCreateActorAndServerAndModel } from './actor'
import { crawlCollectionPage } from './crawl'
const tags = videoObject.tag
.filter(isAPHashTagObject)
.map(tag => tag.name)
- const tagInstances = await TagModel.findOrCreateTags(tags, t)
- await videoUpdated.$set('Tags', tagInstances, sequelizeOptions)
+ await setVideoTags({ video: videoUpdated, tags, transaction: t, defaultValue: videoUpdated.Tags })
}
{
const tags = videoObject.tag
.filter(isAPHashTagObject)
.map(t => t.name)
- const tagInstances = await TagModel.findOrCreateTags(tags, t)
- await videoCreated.$set('Tags', tagInstances, sequelizeOptions)
+ await setVideoTags({ video: videoCreated, tags, transaction: t })
// Process captions
const videoCaptionsPromises = videoObject.subtitleLanguage.map(c => {
await Promise.all(videoCaptionsPromises)
videoCreated.VideoFiles = videoFiles
- videoCreated.Tags = tagInstances
const autoBlacklisted = await autoBlacklistVideoIfNeeded({
video: videoCreated,