From bbd437d1ad340ec88fda21cdf810c7b50b246e7f Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 5 Nov 2018 10:26:59 -0500 Subject: [PATCH] fix video embed url --- client/src/containers/AssetInfo/view.jsx | 5 +++-- server/controllers/pages/sendVideoEmbedPage.js | 9 ++++++++- server/render/build/handleShowRender.js | 9 ++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/client/src/containers/AssetInfo/view.jsx b/client/src/containers/AssetInfo/view.jsx index c4bc14df..af742617 100644 --- a/client/src/containers/AssetInfo/view.jsx +++ b/client/src/containers/AssetInfo/view.jsx @@ -16,7 +16,8 @@ class AssetInfo extends React.Component { const { asset } = this.props; const { claimViews, claimData: { channelName, channelShortId, description, name, fileExt, contentType, thumbnail, host } } = asset; - const assetCanonicalUrl = `${host}${createCanonicalLink({ asset: { ...asset.claimData, shortId: asset.shortId }})}`; + const canonicalUrl = createCanonicalLink({ asset: { ...asset.claimData, shortId: asset.shortId }}); + const assetCanonicalUrl = `${host}${canonicalUrl}`; let channelCanonicalUrl; if (channelName) { @@ -96,7 +97,7 @@ class AssetInfo extends React.Component { {(contentType === 'video/mp4') ? ( `} + value={``} /> ) : ( { } const sendVideoEmbedPage = async ({ params }, res) => { - const { + let { claimId, config, name, } = params; + // if channel then swap name and claimId for order + if (name[0] === '@' && name.includes(':')) { + const temp = name; + name = claimId; + claimId = temp; + } + const logoConfig = await parseLogoConfigParam(config); // test setting response headers diff --git a/server/render/build/handleShowRender.js b/server/render/build/handleShowRender.js index 11c2c9ee..277b9630 100644 --- a/server/render/build/handleShowRender.js +++ b/server/render/build/handleShowRender.js @@ -34,6 +34,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + var createCanonicalLink = require('../../../utils/createCanonicalLink'); var getCanonicalUrlFromShow = function getCanonicalUrlFromShow(show) { @@ -42,8 +46,11 @@ var getCanonicalUrlFromShow = function getCanonicalUrlFromShow(show) { switch (requestType) { case 'ASSET_DETAILS': + var asset = show.assetList[requestId.key]; return createCanonicalLink({ - asset: show.assetList[requestId.key] + asset: _objectSpread({}, asset.claimData, { + shortId: asset.shortId + }) }); case 'CHANNEL':