]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix oembed for playlists
authorChocobozzz <me@florianbigard.com>
Tue, 27 Jul 2021 15:37:59 +0000 (17:37 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 27 Jul 2021 15:37:59 +0000 (17:37 +0200)
server/lib/client-html.ts
server/tests/client.ts

index ae335240e96b9da1141f2a9ff34e9a5ed23c5e06..a557c090f0207faed553627dc762007233a65708 100644 (file)
@@ -162,7 +162,7 @@ class ClientHtml {
     let customHtml = ClientHtml.addTitleTag(html, escapeHTML(videoPlaylist.name))
     customHtml = ClientHtml.addDescriptionTag(customHtml, mdToPlainText(videoPlaylist.description))
 
-    const url = videoPlaylist.getWatchStaticPath()
+    const url = WEBSERVER.URL + videoPlaylist.getWatchStaticPath()
     const originUrl = videoPlaylist.url
     const title = escapeHTML(videoPlaylist.name)
     const siteName = escapeHTML(CONFIG.INSTANCE.NAME)
index 9c27a7aae0d17de25e7d28981112d93a4209ea85..4cbdb2cb39e86fec125f262e155cb10646767ecc 100644 (file)
@@ -119,7 +119,7 @@ describe('Test a client controllers', function () {
           const port = servers[0].port
 
           const expectedLink = '<link rel="alternate" type="application/json+oembed" href="http://localhost:' + port + '/services/oembed?' +
-            `url=http%3A%2F%2Flocalhost%3A${port}%2Fw%2F${servers[0].store.video.uuid}" ` +
+            `url=http%3A%2F%2Flocalhost%3A${port}%2Fw%2F${servers[0].store.video.shortUUID}" ` +
             `title="${servers[0].store.video.name}" />`
 
           expect(res.text).to.contain(expectedLink)
@@ -140,7 +140,7 @@ describe('Test a client controllers', function () {
           const port = servers[0].port
 
           const expectedLink = '<link rel="alternate" type="application/json+oembed" href="http://localhost:' + port + '/services/oembed?' +
-            `url=http%3A%2F%2Flocalhost%3A${port}%2Fw%2Fp%2F${playlist.uuid}" ` +
+            `url=http%3A%2F%2Flocalhost%3A${port}%2Fw%2Fp%2F${playlist.shortUUID}" ` +
             `title="${playlistName}" />`
 
           expect(res.text).to.contain(expectedLink)
@@ -178,7 +178,7 @@ describe('Test a client controllers', function () {
       expect(text).to.contain(`<meta property="og:title" content="${videoName}" />`)
       expect(text).to.contain(`<meta property="og:description" content="${videoDescriptionPlainText}" />`)
       expect(text).to.contain('<meta property="og:type" content="video" />')
-      expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/w/${servers[0].store.video.uuid}" />`)
+      expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/w/${servers[0].store.video.shortUUID}" />`)
     }
 
     async function watchPlaylistPageTest (path: string) {
@@ -188,7 +188,7 @@ describe('Test a client controllers', function () {
       expect(text).to.contain(`<meta property="og:title" content="${playlistName}" />`)
       expect(text).to.contain(`<meta property="og:description" content="${playlistDescription}" />`)
       expect(text).to.contain('<meta property="og:type" content="video" />')
-      expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/w/p/${playlist.uuid}" />`)
+      expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/w/p/${playlist.shortUUID}" />`)
     }
 
     it('Should have valid Open Graph tags on the account page', async function () {