aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-15 11:14:12 +0100
committerChocobozzz <me@florianbigard.com>2019-01-15 14:45:09 +0100
commit848f499def54db2dd36437ef0dfb74dd5041c23b (patch)
tree13e6fcd30e3ce5306d5999fc91561af54d9fd20e /server/lib/activitypub/videos.ts
parent44b9c0ba31c4a97e3d874f33226ad935c3a90dd5 (diff)
downloadPeerTube-848f499def54db2dd36437ef0dfb74dd5041c23b.tar.gz
PeerTube-848f499def54db2dd36437ef0dfb74dd5041c23b.tar.zst
PeerTube-848f499def54db2dd36437ef0dfb74dd5041c23b.zip
Prepare Dislike/Flag/View fixes
For now we Create these activities, but we should just send them directly. This fix handles correctly direct Dislikes/Flags/Views, we'll implement the sending correctly these activities in the next peertube version
Diffstat (limited to 'server/lib/activitypub/videos.ts')
-rw-r--r--server/lib/activitypub/videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index cbdd981c5..e1e523499 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -28,7 +28,7 @@ import { createRates } from './video-rates'
28import { addVideoShares, shareVideoByServerAndChannel } from './share' 28import { addVideoShares, shareVideoByServerAndChannel } from './share'
29import { AccountModel } from '../../models/account/account' 29import { AccountModel } from '../../models/account/account'
30import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video' 30import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video'
31import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub' 31import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
32import { Notifier } from '../notifier' 32import { Notifier } from '../notifier'
33 33
34async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) { 34async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) {
@@ -155,7 +155,7 @@ async function syncVideoExternalAttributes (video: VideoModel, fetchedVideo: Vid
155} 155}
156 156
157async function getOrCreateVideoAndAccountAndChannel (options: { 157async function getOrCreateVideoAndAccountAndChannel (options: {
158 videoObject: VideoTorrentObject | string, 158 videoObject: { id: string } | string,
159 syncParam?: SyncParam, 159 syncParam?: SyncParam,
160 fetchType?: VideoFetchByUrlType, 160 fetchType?: VideoFetchByUrlType,
161 allowRefresh?: boolean // true by default 161 allowRefresh?: boolean // true by default
@@ -166,7 +166,7 @@ async function getOrCreateVideoAndAccountAndChannel (options: {
166 const allowRefresh = options.allowRefresh !== false 166 const allowRefresh = options.allowRefresh !== false
167 167
168 // Get video url 168 // Get video url
169 const videoUrl = getAPUrl(options.videoObject) 169 const videoUrl = getAPId(options.videoObject)
170 170
171 let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType) 171 let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType)
172 if (videoFromDatabase) { 172 if (videoFromDatabase) {