From efc32059d980c51793e8e9ac0fb6a885a8026f94 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Nov 2017 11:08:25 +0100 Subject: Send server announce when users upload a video --- server/lib/activitypub/misc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/activitypub/misc.ts') 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 ( description: videoObject.content, channelId: videoChannel.id, duration: parseInt(duration, 10), - createdAt: videoObject.published, + createdAt: new Date(videoObject.published), // FIXME: updatedAt does not seems to be considered by Sequelize - updatedAt: videoObject.updated, + updatedAt: new Date(videoObject.updated), views: videoObject.views, likes: 0, dislikes: 0, @@ -46,7 +46,7 @@ async function videoActivityObjectToDBAttributes ( function videoFileActivityUrlToDBAttributes (videoCreated: VideoInstance, videoObject: VideoTorrentObject) { const fileUrls = videoObject.url - .filter(u => Object.keys(VIDEO_MIMETYPE_EXT).indexOf(u.mimeType) !== -1) + .filter(u => Object.keys(VIDEO_MIMETYPE_EXT).indexOf(u.mimeType) !== -1 && u.url.startsWith('video/')) const attributes: VideoFileAttributes[] = [] for (const url of fileUrls) { -- cgit v1.2.3