From 093237cf79ea62207b51dd632a4c4fd1f74d71fd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jan 2018 17:09:06 +0100 Subject: Add schema.org tags to videos --- server/models/video/video.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 77c0400d8..81d8a64ff 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -990,8 +990,7 @@ export class VideoModel extends Model { type: 'Video' as 'Video', id: this.url, name: this.name, - // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration - duration: 'PT' + this.duration + 'S', + duration: this.getActivityStreamDuration(), uuid: this.uuid, tag, category, @@ -1161,6 +1160,11 @@ export class VideoModel extends Model { return unlinkPromise(torrentPath) } + getActivityStreamDuration () { + // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration + return 'PT' + this.duration + 'S' + } + private getBaseUrls () { let baseUrlHttp let baseUrlWs -- cgit v1.2.3