diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-25 14:26:12 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-25 14:26:12 +0200 |
commit | 3b46eec8aeb95eb0dce763e3569c0509b1da7607 (patch) | |
tree | c5b638072fb903d9a7690e9174a6c2fb6f9b968f /server | |
parent | f42dd5524b47e89d9b4491f784f05a99303cc934 (diff) | |
download | PeerTube-3b46eec8aeb95eb0dce763e3569c0509b1da7607.tar.gz PeerTube-3b46eec8aeb95eb0dce763e3569c0509b1da7607.tar.zst PeerTube-3b46eec8aeb95eb0dce763e3569c0509b1da7607.zip |
Remove unused param
Diffstat (limited to 'server')
8 files changed, 12 insertions, 10 deletions
diff --git a/server/controllers/api/search/search-videos.ts b/server/controllers/api/search/search-videos.ts index 034a63ace..d0ab7f12a 100644 --- a/server/controllers/api/search/search-videos.ts +++ b/server/controllers/api/search/search-videos.ts | |||
@@ -137,7 +137,6 @@ async function searchVideoURI (url: string, res: express.Response) { | |||
137 | rates: false, | 137 | rates: false, |
138 | shares: false, | 138 | shares: false, |
139 | comments: false, | 139 | comments: false, |
140 | thumbnail: true, | ||
141 | refreshVideo: false | 140 | refreshVideo: false |
142 | } | 141 | } |
143 | 142 | ||
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index e89d1ab45..2e64d981e 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -70,7 +70,7 @@ export { | |||
70 | // --------------------------------------------------------------------------- | 70 | // --------------------------------------------------------------------------- |
71 | 71 | ||
72 | async function processCreateVideo (videoToCreateData: VideoObject, notify: boolean) { | 72 | async function processCreateVideo (videoToCreateData: VideoObject, notify: boolean) { |
73 | const syncParam = { rates: false, shares: false, comments: false, thumbnail: true, refreshVideo: false } | 73 | const syncParam = { rates: false, shares: false, comments: false, refreshVideo: false } |
74 | const { video, created } = await getOrCreateAPVideo({ videoObject: videoToCreateData, syncParam }) | 74 | const { video, created } = await getOrCreateAPVideo({ videoObject: videoToCreateData, syncParam }) |
75 | 75 | ||
76 | if (created && notify) Notifier.Instance.notifyOnNewVideoIfNeeded(video) | 76 | if (created && notify) Notifier.Instance.notifyOnNewVideoIfNeeded(video) |
diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index b65baf0e9..4fdb4e0b7 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts | |||
@@ -89,7 +89,7 @@ async function tryToResolveThreadFromVideo (params: ResolveThreadParams) { | |||
89 | 89 | ||
90 | // Maybe it's a reply to a video? | 90 | // Maybe it's a reply to a video? |
91 | // If yes, it's done: we resolved all the thread | 91 | // If yes, it's done: we resolved all the thread |
92 | const syncParam = { rates: true, shares: true, comments: false, thumbnail: true, refreshVideo: false } | 92 | const syncParam = { rates: true, shares: true, comments: false, refreshVideo: false } |
93 | const { video } = await getOrCreateAPVideo({ videoObject: url, syncParam }) | 93 | const { video } = await getOrCreateAPVideo({ videoObject: url, syncParam }) |
94 | 94 | ||
95 | if (video.isOwned() && !video.hasPrivacyForFederation()) { | 95 | if (video.isOwned() && !video.hasPrivacyForFederation()) { |
diff --git a/server/lib/activitypub/videos/get.ts b/server/lib/activitypub/videos/get.ts index 92387c5d4..288c506ee 100644 --- a/server/lib/activitypub/videos/get.ts +++ b/server/lib/activitypub/videos/get.ts | |||
@@ -43,7 +43,7 @@ async function getOrCreateAPVideo ( | |||
43 | options: GetVideoParamAll | GetVideoParamImmutable | GetVideoParamOther | 43 | options: GetVideoParamAll | GetVideoParamImmutable | GetVideoParamOther |
44 | ): GetVideoResult<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail | MVideoImmutable> { | 44 | ): GetVideoResult<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail | MVideoImmutable> { |
45 | // Default params | 45 | // Default params |
46 | const syncParam = options.syncParam || { rates: true, shares: true, comments: true, thumbnail: true, refreshVideo: false } | 46 | const syncParam = options.syncParam || { rates: true, shares: true, comments: true, refreshVideo: false } |
47 | const fetchType = options.fetchType || 'all' | 47 | const fetchType = options.fetchType || 'all' |
48 | const allowRefresh = options.allowRefresh !== false | 48 | const allowRefresh = options.allowRefresh !== false |
49 | 49 | ||
@@ -68,7 +68,7 @@ async function getOrCreateAPVideo ( | |||
68 | 68 | ||
69 | try { | 69 | try { |
70 | const creator = new APVideoCreator(videoObject) | 70 | const creator = new APVideoCreator(videoObject) |
71 | const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator), syncParam.thumbnail) | 71 | const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator)) |
72 | 72 | ||
73 | await syncVideoExternalAttributes(videoCreated, videoObject, syncParam) | 73 | await syncVideoExternalAttributes(videoCreated, videoObject, syncParam) |
74 | 74 | ||
diff --git a/server/lib/activitypub/videos/shared/creator.ts b/server/lib/activitypub/videos/shared/creator.ts index 512d14d82..e44fd0d52 100644 --- a/server/lib/activitypub/videos/shared/creator.ts +++ b/server/lib/activitypub/videos/shared/creator.ts | |||
@@ -18,7 +18,7 @@ export class APVideoCreator extends APVideoAbstractBuilder { | |||
18 | this.lTags = loggerTagsFactory('ap', 'video', 'create', this.videoObject.uuid, this.videoObject.id) | 18 | this.lTags = loggerTagsFactory('ap', 'video', 'create', this.videoObject.uuid, this.videoObject.id) |
19 | } | 19 | } |
20 | 20 | ||
21 | async create (waitThumbnail = false) { | 21 | async create () { |
22 | logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags()) | 22 | logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags()) |
23 | 23 | ||
24 | const channelActor = await this.getOrCreateVideoChannelFromVideoObject() | 24 | const channelActor = await this.getOrCreateVideoChannelFromVideoObject() |
diff --git a/server/lib/activitypub/videos/shared/video-sync-attributes.ts b/server/lib/activitypub/videos/shared/video-sync-attributes.ts index e3cb96a62..aa37f3d34 100644 --- a/server/lib/activitypub/videos/shared/video-sync-attributes.ts +++ b/server/lib/activitypub/videos/shared/video-sync-attributes.ts | |||
@@ -17,11 +17,14 @@ type SyncParam = { | |||
17 | rates: boolean | 17 | rates: boolean |
18 | shares: boolean | 18 | shares: boolean |
19 | comments: boolean | 19 | comments: boolean |
20 | thumbnail: boolean | ||
21 | refreshVideo?: boolean | 20 | refreshVideo?: boolean |
22 | } | 21 | } |
23 | 22 | ||
24 | async function syncVideoExternalAttributes (video: MVideo, fetchedVideo: VideoObject, syncParam: SyncParam) { | 23 | async function syncVideoExternalAttributes ( |
24 | video: MVideo, | ||
25 | fetchedVideo: VideoObject, | ||
26 | syncParam: Pick<SyncParam, 'rates' | 'shares' | 'comments'> | ||
27 | ) { | ||
25 | logger.info('Adding likes/dislikes/shares/comments of video %s.', video.uuid) | 28 | logger.info('Adding likes/dislikes/shares/comments of video %s.', video.uuid) |
26 | 29 | ||
27 | const ratePromise = updateVideoRates(video, fetchedVideo) | 30 | const ratePromise = updateVideoRates(video, fetchedVideo) |
diff --git a/server/lib/job-queue/handlers/activitypub-refresher.ts b/server/lib/job-queue/handlers/activitypub-refresher.ts index 307e771ff..706bf17fa 100644 --- a/server/lib/job-queue/handlers/activitypub-refresher.ts +++ b/server/lib/job-queue/handlers/activitypub-refresher.ts | |||
@@ -28,7 +28,7 @@ export { | |||
28 | 28 | ||
29 | async function refreshVideo (videoUrl: string) { | 29 | async function refreshVideo (videoUrl: string) { |
30 | const fetchType = 'all' as 'all' | 30 | const fetchType = 'all' as 'all' |
31 | const syncParam = { rates: true, shares: true, comments: true, thumbnail: true } | 31 | const syncParam = { rates: true, shares: true, comments: true } |
32 | 32 | ||
33 | const videoFromDatabase = await loadVideoByUrl(videoUrl, fetchType) | 33 | const videoFromDatabase = await loadVideoByUrl(videoUrl, fetchType) |
34 | if (videoFromDatabase) { | 34 | if (videoFromDatabase) { |
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 24d340a73..91625ccb5 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts | |||
@@ -365,7 +365,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
365 | // We need more attributes and check if the video still exists | 365 | // We need more attributes and check if the video still exists |
366 | const getVideoOptions = { | 366 | const getVideoOptions = { |
367 | videoObject: videoUrl, | 367 | videoObject: videoUrl, |
368 | syncParam: { rates: false, shares: false, comments: false, thumbnail: false, refreshVideo: true }, | 368 | syncParam: { rates: false, shares: false, comments: false, refreshVideo: true }, |
369 | fetchType: 'all' as 'all' | 369 | fetchType: 'all' as 'all' |
370 | } | 370 | } |
371 | const { video } = await getOrCreateAPVideo(getVideoOptions) | 371 | const { video } = await getOrCreateAPVideo(getVideoOptions) |