diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-16 11:08:25 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:52 +0100 |
commit | efc32059d980c51793e8e9ac0fb6a885a8026f94 (patch) | |
tree | c272e63fd57a9625b53dc26ceb1b46aee35d21d3 /server/lib/activitypub/misc.ts | |
parent | d846501818c2d29e66e6fd141789cb04fd55a437 (diff) | |
download | PeerTube-efc32059d980c51793e8e9ac0fb6a885a8026f94.tar.gz PeerTube-efc32059d980c51793e8e9ac0fb6a885a8026f94.tar.zst PeerTube-efc32059d980c51793e8e9ac0fb6a885a8026f94.zip |
Send server announce when users upload a video
Diffstat (limited to 'server/lib/activitypub/misc.ts')
-rw-r--r-- | server/lib/activitypub/misc.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/misc.ts b/server/lib/activitypub/misc.ts index 2cf0c4fd1..43d26c328 100644 --- a/server/lib/activitypub/misc.ts +++ b/server/lib/activitypub/misc.ts | |||
@@ -28,9 +28,9 @@ async function videoActivityObjectToDBAttributes ( | |||
28 | description: videoObject.content, | 28 | description: videoObject.content, |
29 | channelId: videoChannel.id, | 29 | channelId: videoChannel.id, |
30 | duration: parseInt(duration, 10), | 30 | duration: parseInt(duration, 10), |
31 | createdAt: videoObject.published, | 31 | createdAt: new Date(videoObject.published), |
32 | // FIXME: updatedAt does not seems to be considered by Sequelize | 32 | // FIXME: updatedAt does not seems to be considered by Sequelize |
33 | updatedAt: videoObject.updated, | 33 | updatedAt: new Date(videoObject.updated), |
34 | views: videoObject.views, | 34 | views: videoObject.views, |
35 | likes: 0, | 35 | likes: 0, |
36 | dislikes: 0, | 36 | dislikes: 0, |
@@ -46,7 +46,7 @@ async function videoActivityObjectToDBAttributes ( | |||
46 | 46 | ||
47 | function videoFileActivityUrlToDBAttributes (videoCreated: VideoInstance, videoObject: VideoTorrentObject) { | 47 | function videoFileActivityUrlToDBAttributes (videoCreated: VideoInstance, videoObject: VideoTorrentObject) { |
48 | const fileUrls = videoObject.url | 48 | const fileUrls = videoObject.url |
49 | .filter(u => Object.keys(VIDEO_MIMETYPE_EXT).indexOf(u.mimeType) !== -1) | 49 | .filter(u => Object.keys(VIDEO_MIMETYPE_EXT).indexOf(u.mimeType) !== -1 && u.url.startsWith('video/')) |
50 | 50 | ||
51 | const attributes: VideoFileAttributes[] = [] | 51 | const attributes: VideoFileAttributes[] = [] |
52 | for (const url of fileUrls) { | 52 | for (const url of fileUrls) { |