]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/client.ts
Move server follow in the job queue
[github/Chocobozzz/PeerTube.git] / server / controllers / client.ts
index 2fcca6f761227ffd4d8774eb19ec88c928aa2c1b..b5dc7b7eddf13d9ca2cc121dfa16ff065852e8f8 100644 (file)
@@ -10,7 +10,7 @@ import { VideoModel } from '../models/video/video'
 const clientsRouter = express.Router()
 
 const distPath = join(root(), 'client', 'dist')
-const assetsImagesPath = join(root(), 'client', 'dist', 'client', 'assets', 'images')
+const assetsImagesPath = join(root(), 'client', 'dist', 'assets', 'images')
 const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
 const indexPath = join(distPath, 'index.html')
 
@@ -100,11 +100,12 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoModel) {
     '@type': 'VideoObject',
     name: videoNameEscaped,
     description: videoDescriptionEscaped,
+    thumbnailUrl: previewUrl,
+    uploadDate: video.createdAt.toISOString(),
     duration: video.getActivityStreamDuration(),
-    thumbnailURL: previewUrl,
-    contentURL: videoUrl,
-    embedURL: embedUrl,
-    uploadDate: video.createdAt
+    contentUrl: videoUrl,
+    embedUrl: embedUrl,
+    interactionCount: video.views
   }
 
   let tagsString = ''
@@ -124,6 +125,9 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoModel) {
   // Schema.org
   tagsString += `<script type="application/ld+json">${JSON.stringify(schemaTags)}</script>`
 
+  // SEO
+  tagsString += `<link rel="canonical" href="${videoUrl}" />`
+
   return htmlStringPage.replace(OPENGRAPH_AND_OEMBED_COMMENT, tagsString)
 }