diff --git a/src/renderer/components/subscriptions-community/subscriptions-community.js b/src/renderer/components/subscriptions-community/subscriptions-community.js index cb44b54c921ea..c4f044bf153b0 100644 --- a/src/renderer/components/subscriptions-community/subscriptions-community.js +++ b/src/renderer/components/subscriptions-community/subscriptions-community.js @@ -235,9 +235,7 @@ export default defineComponent({ this.errorChannels.push(channel) return [] } - entries.forEach(post => { - post.authorId = channel.id - }) + return entries } catch (err) { console.error(err) @@ -256,9 +254,6 @@ export default defineComponent({ getChannelPostsInvidious: function (channel) { return new Promise((resolve, reject) => { invidiousGetCommunityPosts(channel.id).then(result => { - result.posts.forEach(post => { - post.authorId = channel.id - }) resolve(result.posts) }).catch((err) => { console.error(err) diff --git a/src/renderer/helpers/api/invidious.js b/src/renderer/helpers/api/invidious.js index 0b830d697183d..ab92d68cfe513 100644 --- a/src/renderer/helpers/api/invidious.js +++ b/src/renderer/helpers/api/invidious.js @@ -274,6 +274,7 @@ function parseInvidiousCommunityData(data) { voteCount: data.likeCount, postContent: parseInvidiousCommunityAttachments(data.attachment), commentCount: data?.replyCount ?? 0, // https://github.com/iv-org/invidious/pull/3635/ + authorId: data.authorId, author: data.author, type: 'community' } diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index cc982b6fb48a4..cd9f1da96c5b3 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -1489,6 +1489,7 @@ function parseLocalCommunityPost(post) { voteCount: post.vote_count ? parseLocalSubscriberCount(post.vote_count.text) : 0, postContent: parseLocalAttachment(post.attachment), commentCount: replyCount, + authorId: post.author.id, author: post.author.name, type: 'community' } diff --git a/src/renderer/views/Channel/Channel.js b/src/renderer/views/Channel/Channel.js index eeb6c7b289ff2..2230ce23bda46 100644 --- a/src/renderer/views/Channel/Channel.js +++ b/src/renderer/views/Channel/Channel.js @@ -1697,9 +1697,6 @@ export default defineComponent({ this.communityContinuationData = communityTab.has_continuation ? communityTab : null if (this.latestCommunityPosts.length > 0) { - this.latestCommunityPosts.forEach(post => { - post.authorId = this.id - }) this.updateSubscriptionPostsCacheByChannel({ channelId: this.id, // create a copy so that we only cache the first page @@ -1761,9 +1758,6 @@ export default defineComponent({ this.communityContinuationData = continuation if (this.isSubscribedInAnyProfile && !more && this.latestCommunityPosts.length > 0) { - this.latestCommunityPosts.forEach(post => { - post.authorId = this.id - }) this.updateSubscriptionPostsCacheByChannel({ channelId: this.id, // create a copy so that we only cache the first page @@ -2009,9 +2003,6 @@ export default defineComponent({ }) } - this.latestCommunityPosts.forEach(post => { - post.authorId = this.id - }) this.updateSubscriptionPostsCacheByChannel({ channelId: this.id, posts: [...this.latestCommunityPosts]