update arguments order
This commit is contained in:
parent
61d55604a4
commit
de15a56ed8
1 changed files with 5 additions and 5 deletions
|
@ -138,7 +138,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) {
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getClaimFromChainqueryOrRedirect(url, ctx) {
|
async function getClaimFromChainqueryOrRedirect(ctx, url) {
|
||||||
const { isChannel, streamName, channelName, channelClaimId, streamClaimId } = parseURI(url);
|
const { isChannel, streamName, channelName, channelClaimId, streamClaimId } = parseURI(url);
|
||||||
const claimName = isChannel ? '@' + channelName : streamName;
|
const claimName = isChannel ? '@' + channelName : streamName;
|
||||||
const claimId = isChannel ? channelClaimId : streamClaimId;
|
const claimId = isChannel ? channelClaimId : streamClaimId;
|
||||||
|
@ -179,7 +179,7 @@ async function getHtml(ctx) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parseURI(inviteChannelUrl);
|
parseURI(inviteChannelUrl);
|
||||||
const claim = await getClaimFromChainqueryOrRedirect(inviteChannelUrl, ctx);
|
const claim = await getClaimFromChainqueryOrRedirect(ctx, inviteChannelUrl);
|
||||||
const invitePageMetadata = buildClaimOgMetadata(inviteChannelUrl, claim, {
|
const invitePageMetadata = buildClaimOgMetadata(inviteChannelUrl, claim, {
|
||||||
title: `Join ${claim.name} on LBRY`,
|
title: `Join ${claim.name} on LBRY`,
|
||||||
description: `Join ${claim.name} on LBRY, a content wonderland owned by everyone (and no one).`,
|
description: `Join ${claim.name} on LBRY, a content wonderland owned by everyone (and no one).`,
|
||||||
|
@ -199,7 +199,7 @@ async function getHtml(ctx) {
|
||||||
|
|
||||||
if (requestPath.includes(embedPath)) {
|
if (requestPath.includes(embedPath)) {
|
||||||
const claimUri = requestPath.replace(embedPath, '').replace(/:/g, '#');
|
const claimUri = requestPath.replace(embedPath, '').replace(/:/g, '#');
|
||||||
const claim = await getClaimFromChainqueryOrRedirect(claimUri, ctx);
|
const claim = await getClaimFromChainqueryOrRedirect(ctx, claimUri);
|
||||||
|
|
||||||
if (claim) {
|
if (claim) {
|
||||||
const ogMetadata = buildClaimOgMetadata(claimUri, claim);
|
const ogMetadata = buildClaimOgMetadata(claimUri, claim);
|
||||||
|
@ -211,8 +211,8 @@ async function getHtml(ctx) {
|
||||||
|
|
||||||
if (!requestPath.includes('$')) {
|
if (!requestPath.includes('$')) {
|
||||||
const claimUri = requestPath.slice(1).replace(/:/g, '#');
|
const claimUri = requestPath.slice(1).replace(/:/g, '#');
|
||||||
const claim = await getClaimFromChainqueryOrRedirect(claimUri, ctx);
|
const claim = await getClaimFromChainqueryOrRedirect(ctx, claimUri);
|
||||||
console.log('claim', claim);
|
|
||||||
if (claim) {
|
if (claim) {
|
||||||
const ogMetadata = buildClaimOgMetadata(claimUri, claim);
|
const ogMetadata = buildClaimOgMetadata(claimUri, claim);
|
||||||
return insertToHead(html, ogMetadata);
|
return insertToHead(html, ogMetadata);
|
||||||
|
|
Loading…
Add table
Reference in a new issue