Skip to content

Commit

Permalink
Only show the YouTube thumbnail image if the video is not embedded.
Browse files Browse the repository at this point in the history
  • Loading branch information
loganrockmore committed Jan 5, 2021
1 parent f0c44b1 commit 2b9200e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/routes/youtube/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module.exports = async (ctx) => {
return {
title: snippet.title,
description: `${
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''
}${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'
}${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
};
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/youtube/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module.exports = async (ctx) => {
const img = utils.getThumbnail(snippet.thumbnails);
return {
title: snippet.title,
description: `${embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''}
${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
description: `${embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'}
${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
author: authors[index].snippet.channelTitle,
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/youtube/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module.exports = async (ctx) => {
return {
title: snippet.title,
description: `${
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''
}${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'
}${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
};
Expand Down

0 comments on commit 2b9200e

Please sign in to comment.