Skip to content

Commit

Permalink
add 'local' to function name to get post comments, update innertube m…
Browse files Browse the repository at this point in the history
…ethods to reflect naming changes made in the youtube.js PR
  • Loading branch information
ChunkyProgrammer committed Feb 2, 2025
1 parent 43825c6 commit d10950c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/renderer/components/CommentSection/CommentSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand All @@ -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')
}
4 changes: 2 additions & 2 deletions src/renderer/views/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d10950c

Please sign in to comment.