import { doRequest } from '../../helpers/requests'
import { getOrCreateActorAndServerAndModel } from './actor'
import { logger } from '../../helpers/logger'
-import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers'
+import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
async function shareVideoByServerAndChannel (video: VideoModel, t: Transaction) {
url: shareUrl
}
- await VideoShareModel.findOrCreate({
- where: {
- url: shareUrl
- },
- defaults: entry
- })
+ await VideoShareModel.upsert(entry)
} catch (err) {
logger.warn('Cannot add share %s.', shareUrl, { err })
}