From d10950c744f3730402557b8bae3482562d3f8c4a Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:00:54 -0500 Subject: [PATCH] add 'local' to function name to get post comments, update innertube methods to reflect naming changes made in the youtube.js PR --- src/renderer/components/CommentSection/CommentSection.vue | 4 ++-- src/renderer/helpers/api/local.js | 8 ++++---- src/renderer/views/Post.vue | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/CommentSection/CommentSection.vue b/src/renderer/components/CommentSection/CommentSection.vue index 0967de79f530e..928ed957d947b 100644 --- a/src/renderer/components/CommentSection/CommentSection.vue +++ b/src/renderer/components/CommentSection/CommentSection.vue @@ -314,7 +314,7 @@ import FtTimestampCatcher from '../FtTimestampCatcher.vue' import store from '../../store/index' import { copyToClipboard, showToast } from '../../helpers/utils' -import { getCommunityPostComments, getLocalComments, parseLocalComment } from '../../helpers/api/local' +import { getLocalCommunityPostComments, getLocalComments, parseLocalComment } from '../../helpers/api/local' import { getInvidiousCommunityPostCommentReplies, getInvidiousCommunityPostComments, @@ -546,7 +546,7 @@ async function getCommentDataLocal(more = false) { localCommentsInstance = comments } else { if (props.isPostComments) { - comments = await getCommunityPostComments(props.id, props.postAuthorId, sortNewest.value) + comments = await getLocalCommunityPostComments(props.id, props.postAuthorId, sortNewest.value) } else { comments = await getLocalComments(props.id) sortNewest.value = comments.header?.sort_menu?.sub_menu_items?.[1].selected ?? false diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index 2c346c41d5ed4..b0a48b1689c74 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -1694,14 +1694,14 @@ export async function getHashtagLocal(hashtag) { return await innertube.getHashtag(hashtag) } -export async function getCommunityPostLocal(postId, channelId) { +export async function getLocalCommunityPost(postId, channelId) { const innertube = await createInnertube() if (channelId == null) { const resolved = await innertube.resolveURL('https://www.youtube.com/post/' + postId) channelId = resolved.payload.browseId } - const postPage = await innertube.GetPost(postId, channelId) + const postPage = await innertube.getPost(postId, channelId) return parseLocalCommunityPost(postPage.posts.first()) } @@ -1710,8 +1710,8 @@ export async function getCommunityPostLocal(postId, channelId) { * @param {string} channelId * @param {boolean} sortByNewest */ -export async function getCommunityPostComments(postId, channelId, sortByNewest) { +export async function getLocalCommunityPostComments(postId, channelId, sortByNewest) { const innertube = await createInnertube() - return await innertube.GetPostComments(postId, channelId, sortByNewest ? 'NEWEST_FIRST' : 'TOP_COMMENTS') + return await innertube.getPostComments(postId, channelId, sortByNewest ? 'NEWEST_FIRST' : 'TOP_COMMENTS') } diff --git a/src/renderer/views/Post.vue b/src/renderer/views/Post.vue index fd1649919ec87..b5c08593469c2 100644 --- a/src/renderer/views/Post.vue +++ b/src/renderer/views/Post.vue @@ -39,7 +39,7 @@ import CommentSection from '../components/CommentSection/CommentSection.vue' import store from '../store/index' import { getInvidiousCommunityPost } from '../helpers/api/invidious' -import { getCommunityPostLocal } from '../helpers/api/local' +import { getLocalCommunityPost } from '../helpers/api/local' import { copyToClipboard, showToast } from '../helpers/utils' const { t } = useI18n() @@ -92,7 +92,7 @@ function updateTitleAndRoute() { async function loadDataLocalAsync() { try { - post.value = await getCommunityPostLocal(id.value, authorId.value) + post.value = await getLocalCommunityPost(id.value, authorId.value) authorId.value = post.value.authorId updateTitleAndRoute() } catch (error) {