From 9df6e248ad0a1dda8d26e36ea94120d4553812c9 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 7 Oct 2020 17:48:53 +0200 Subject: [PATCH 1/2] Comment display, Comment links Added: Comment links - Links in comments are now clikcable and displayed in blue Fixed: Comment display - Comments should now display the whole text. They were cut of due to an issue in the module, which is now fixed --- package-lock.json | 6 +++--- package.json | 2 +- .../components/watch-video-comments/watch-video-comments.js | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41610f5b..d884fa01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20577,9 +20577,9 @@ } }, "yt-comment-scraper": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/yt-comment-scraper/-/yt-comment-scraper-1.3.3.tgz", - "integrity": "sha512-t0mIJOxsXriJTVIzQpRYz7BcAo2SbhhgY8YR2HJjxEq5zBYsu6mVujs8xzrCo1431hri1mDTanvLluS/WWCgjg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/yt-comment-scraper/-/yt-comment-scraper-1.3.4.tgz", + "integrity": "sha512-/sf4hmjHBNtGItrZiHWetWwp3Q66G0Ur1HGKsP0Enfpxsq4/1otrie11dPCINl4oBmt5qQ0jVJt5j44zvom4Xg==", "requires": { "axios": "^0.19.2", "html2json": "^1.0.2" diff --git a/package.json b/package.json index fa1929f0..f47c0927 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "youtube-chat": "^1.1.0", "youtube-suggest": "^1.1.0", "yt-channel-info": "^1.1.3", - "yt-comment-scraper": "^1.3.3", + "yt-comment-scraper": "^1.3.4", "yt-dash-manifest-generator": "^1.1.0", "yt-trending-scraper": "^1.0.3", "yt-xml2vtt": "^1.1.2", diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.js b/src/renderer/components/watch-video-comments/watch-video-comments.js index 61fa8567..424b18ad 100644 --- a/src/renderer/components/watch-video-comments/watch-video-comments.js +++ b/src/renderer/components/watch-video-comments/watch-video-comments.js @@ -4,7 +4,7 @@ import FtCard from '../ft-card/ft-card.vue' import FtLoader from '../../components/ft-loader/ft-loader.vue' import FtSelect from '../../components/ft-select/ft-select.vue' import FtTimestampCatcher from '../../components/ft-timestamp-catcher/ft-timestamp-catcher.vue' - +import autolinker from 'autolinker' import CommentScraper from 'yt-comment-scraper' export default Vue.extend({ @@ -121,7 +121,7 @@ export default Vue.extend({ this.commentScraper.scrape_next_page_youtube_comments(this.id).then((response) => { if (response === null) { this.showToast({ - message: this.$t('No more comments available'), + message: this.$t('Comments.No more comments available'), time: 7000, action: () => { } @@ -150,6 +150,7 @@ export default Vue.extend({ if (this.hideCommentLikes) { comment.likes = null } + comment.text = autolinker.link(comment.text) return comment }) this.commentData = this.commentData.concat(commentData) From 70fae4dcfc70bf85f43491a2d4c158d6e70ef5e6 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 7 Oct 2020 17:59:24 +0200 Subject: [PATCH 2/2] Added the link display to the replies --- .../watch-video-comments/watch-video-comments.js | 3 +++ .../watch-video-comments/watch-video-comments.vue | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.js b/src/renderer/components/watch-video-comments/watch-video-comments.js index 424b18ad..61890fd2 100644 --- a/src/renderer/components/watch-video-comments/watch-video-comments.js +++ b/src/renderer/components/watch-video-comments/watch-video-comments.js @@ -151,6 +151,9 @@ export default Vue.extend({ comment.likes = null } comment.text = autolinker.link(comment.text) + comment.replies.forEach((reply) => { + reply.text = autolinker.link(reply.text) + }) return comment }) this.commentData = this.commentData.concat(commentData) diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.vue b/src/renderer/components/watch-video-comments/watch-video-comments.vue index 9692f77a..abebf4a2 100644 --- a/src/renderer/components/watch-video-comments/watch-video-comments.vue +++ b/src/renderer/components/watch-video-comments/watch-video-comments.vue @@ -96,9 +96,11 @@ {{ reply.time }}

-

- {{ reply.text }} -

+