aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-23 17:09:06 +0100
committerChocobozzz <me@florianbigard.com>2018-01-23 17:09:06 +0100
commit093237cf79ea62207b51dd632a4c4fd1f74d71fd (patch)
tree97286c140fdc23dfe1b19f8c0689a1f6140f7010 /server/models/video
parent63c4b44961aa86ed4dabf039e495879103f9d729 (diff)
downloadPeerTube-093237cf79ea62207b51dd632a4c4fd1f74d71fd.tar.gz
PeerTube-093237cf79ea62207b51dd632a4c4fd1f74d71fd.tar.zst
PeerTube-093237cf79ea62207b51dd632a4c4fd1f74d71fd.zip
Add schema.org tags to videos
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts8
1 files changed, 6 insertions, 2 deletions
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<VideoModel> {
990 type: 'Video' as 'Video', 990 type: 'Video' as 'Video',
991 id: this.url, 991 id: this.url,
992 name: this.name, 992 name: this.name,
993 // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration 993 duration: this.getActivityStreamDuration(),
994 duration: 'PT' + this.duration + 'S',
995 uuid: this.uuid, 994 uuid: this.uuid,
996 tag, 995 tag,
997 category, 996 category,
@@ -1161,6 +1160,11 @@ export class VideoModel extends Model<VideoModel> {
1161 return unlinkPromise(torrentPath) 1160 return unlinkPromise(torrentPath)
1162 } 1161 }
1163 1162
1163 getActivityStreamDuration () {
1164 // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration
1165 return 'PT' + this.duration + 'S'
1166 }
1167
1164 private getBaseUrls () { 1168 private getBaseUrls () {
1165 let baseUrlHttp 1169 let baseUrlHttp
1166 let baseUrlWs 1170 let baseUrlWs