Remove unused param
This commit is contained in:
parent
f42dd5524b
commit
3b46eec8ae
8 changed files with 12 additions and 10 deletions
|
@ -137,7 +137,6 @@ async function searchVideoURI (url: string, res: express.Response) {
|
||||||
rates: false,
|
rates: false,
|
||||||
shares: false,
|
shares: false,
|
||||||
comments: false,
|
comments: false,
|
||||||
thumbnail: true,
|
|
||||||
refreshVideo: false
|
refreshVideo: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ export {
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
async function processCreateVideo (videoToCreateData: VideoObject, notify: boolean) {
|
async function processCreateVideo (videoToCreateData: VideoObject, notify: boolean) {
|
||||||
const syncParam = { rates: false, shares: false, comments: false, thumbnail: true, refreshVideo: false }
|
const syncParam = { rates: false, shares: false, comments: false, refreshVideo: false }
|
||||||
const { video, created } = await getOrCreateAPVideo({ videoObject: videoToCreateData, syncParam })
|
const { video, created } = await getOrCreateAPVideo({ videoObject: videoToCreateData, syncParam })
|
||||||
|
|
||||||
if (created && notify) Notifier.Instance.notifyOnNewVideoIfNeeded(video)
|
if (created && notify) Notifier.Instance.notifyOnNewVideoIfNeeded(video)
|
||||||
|
|
|
@ -89,7 +89,7 @@ async function tryToResolveThreadFromVideo (params: ResolveThreadParams) {
|
||||||
|
|
||||||
// Maybe it's a reply to a video?
|
// Maybe it's a reply to a video?
|
||||||
// If yes, it's done: we resolved all the thread
|
// If yes, it's done: we resolved all the thread
|
||||||
const syncParam = { rates: true, shares: true, comments: false, thumbnail: true, refreshVideo: false }
|
const syncParam = { rates: true, shares: true, comments: false, refreshVideo: false }
|
||||||
const { video } = await getOrCreateAPVideo({ videoObject: url, syncParam })
|
const { video } = await getOrCreateAPVideo({ videoObject: url, syncParam })
|
||||||
|
|
||||||
if (video.isOwned() && !video.hasPrivacyForFederation()) {
|
if (video.isOwned() && !video.hasPrivacyForFederation()) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ async function getOrCreateAPVideo (
|
||||||
options: GetVideoParamAll | GetVideoParamImmutable | GetVideoParamOther
|
options: GetVideoParamAll | GetVideoParamImmutable | GetVideoParamOther
|
||||||
): GetVideoResult<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail | MVideoImmutable> {
|
): GetVideoResult<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail | MVideoImmutable> {
|
||||||
// Default params
|
// Default params
|
||||||
const syncParam = options.syncParam || { rates: true, shares: true, comments: true, thumbnail: true, refreshVideo: false }
|
const syncParam = options.syncParam || { rates: true, shares: true, comments: true, refreshVideo: false }
|
||||||
const fetchType = options.fetchType || 'all'
|
const fetchType = options.fetchType || 'all'
|
||||||
const allowRefresh = options.allowRefresh !== false
|
const allowRefresh = options.allowRefresh !== false
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ async function getOrCreateAPVideo (
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const creator = new APVideoCreator(videoObject)
|
const creator = new APVideoCreator(videoObject)
|
||||||
const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator), syncParam.thumbnail)
|
const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator))
|
||||||
|
|
||||||
await syncVideoExternalAttributes(videoCreated, videoObject, syncParam)
|
await syncVideoExternalAttributes(videoCreated, videoObject, syncParam)
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class APVideoCreator extends APVideoAbstractBuilder {
|
||||||
this.lTags = loggerTagsFactory('ap', 'video', 'create', this.videoObject.uuid, this.videoObject.id)
|
this.lTags = loggerTagsFactory('ap', 'video', 'create', this.videoObject.uuid, this.videoObject.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
async create (waitThumbnail = false) {
|
async create () {
|
||||||
logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags())
|
logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags())
|
||||||
|
|
||||||
const channelActor = await this.getOrCreateVideoChannelFromVideoObject()
|
const channelActor = await this.getOrCreateVideoChannelFromVideoObject()
|
||||||
|
|
|
@ -17,11 +17,14 @@ type SyncParam = {
|
||||||
rates: boolean
|
rates: boolean
|
||||||
shares: boolean
|
shares: boolean
|
||||||
comments: boolean
|
comments: boolean
|
||||||
thumbnail: boolean
|
|
||||||
refreshVideo?: boolean
|
refreshVideo?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
async function syncVideoExternalAttributes (video: MVideo, fetchedVideo: VideoObject, syncParam: SyncParam) {
|
async function syncVideoExternalAttributes (
|
||||||
|
video: MVideo,
|
||||||
|
fetchedVideo: VideoObject,
|
||||||
|
syncParam: Pick<SyncParam, 'rates' | 'shares' | 'comments'>
|
||||||
|
) {
|
||||||
logger.info('Adding likes/dislikes/shares/comments of video %s.', video.uuid)
|
logger.info('Adding likes/dislikes/shares/comments of video %s.', video.uuid)
|
||||||
|
|
||||||
const ratePromise = updateVideoRates(video, fetchedVideo)
|
const ratePromise = updateVideoRates(video, fetchedVideo)
|
||||||
|
|
|
@ -28,7 +28,7 @@ export {
|
||||||
|
|
||||||
async function refreshVideo (videoUrl: string) {
|
async function refreshVideo (videoUrl: string) {
|
||||||
const fetchType = 'all' as 'all'
|
const fetchType = 'all' as 'all'
|
||||||
const syncParam = { rates: true, shares: true, comments: true, thumbnail: true }
|
const syncParam = { rates: true, shares: true, comments: true }
|
||||||
|
|
||||||
const videoFromDatabase = await loadVideoByUrl(videoUrl, fetchType)
|
const videoFromDatabase = await loadVideoByUrl(videoUrl, fetchType)
|
||||||
if (videoFromDatabase) {
|
if (videoFromDatabase) {
|
||||||
|
|
|
@ -365,7 +365,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
|
||||||
// We need more attributes and check if the video still exists
|
// We need more attributes and check if the video still exists
|
||||||
const getVideoOptions = {
|
const getVideoOptions = {
|
||||||
videoObject: videoUrl,
|
videoObject: videoUrl,
|
||||||
syncParam: { rates: false, shares: false, comments: false, thumbnail: false, refreshVideo: true },
|
syncParam: { rates: false, shares: false, comments: false, refreshVideo: true },
|
||||||
fetchType: 'all' as 'all'
|
fetchType: 'all' as 'all'
|
||||||
}
|
}
|
||||||
const { video } = await getOrCreateAPVideo(getVideoOptions)
|
const { video } = await getOrCreateAPVideo(getVideoOptions)
|
||||||
|
|
Loading…
Reference in a new issue