GoogleVideoSearch: fix blank description; invalid thumbnails
## Issue Closes 5923 video metadata issues ## Notes For thumbnails, future claims should have correct thumbnails after `5925 Fix thumbnail-checking and block 'data:image'`. For existing claims, we'll just skip the metadata to avoid the crawler error. Users can easily update their thumbnails. For the `OlivOliv` thumbnail url case, I wasn't sure whether to go all out to fetch and verify each thumbnail. I ended up just checking whether it starts with `http(s)`
This commit is contained in:
parent
cb2c33a35f
commit
8493b1e3df
1 changed files with 9 additions and 1 deletions
|
@ -191,11 +191,19 @@ function buildGoogleVideoMetadata(claimUri, claim) {
|
||||||
thumbnailUrl: `${claimThumbnail}`,
|
thumbnailUrl: `${claimThumbnail}`,
|
||||||
uploadDate: `${new Date(releaseTime * 1000).toISOString()}`,
|
uploadDate: `${new Date(releaseTime * 1000).toISOString()}`,
|
||||||
// --- Recommended ---
|
// --- Recommended ---
|
||||||
duration: moment.duration(claim.duration * 1000).toISOString(),
|
duration: claim.duration ? moment.duration(claim.duration * 1000).toISOString() : undefined,
|
||||||
contentUrl: generateDirectUrl(claim.name, claim.claim_id),
|
contentUrl: generateDirectUrl(claim.name, claim.claim_id),
|
||||||
embedUrl: generateEmbedUrl(claim.name, claim.claim_id),
|
embedUrl: generateEmbedUrl(claim.name, claim.claim_id),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (
|
||||||
|
!googleVideoMetadata.description.replace(/\s/g, '').length ||
|
||||||
|
googleVideoMetadata.thumbnailUrl.startsWith('data:image') ||
|
||||||
|
!googleVideoMetadata.thumbnailUrl.startsWith('http')
|
||||||
|
) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
'<script type="application/ld+json">\n' + JSON.stringify(googleVideoMetadata, null, ' ') + '\n' + '</script>\n'
|
'<script type="application/ld+json">\n' + JSON.stringify(googleVideoMetadata, null, ' ') + '\n' + '</script>\n'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue