Skip to content
Prev Previous commit
* Remove unnecessary changes
  • Loading branch information
PikachuEXE committed Apr 26, 2025
commit fd800c388fd05f98c65845d9fa4ce52a9585be6d
4 changes: 1 addition & 3 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,9 +1190,7 @@ export function parseLocalListVideo(item, channelId, channelName) {
isVr180: video.badges.some(badge => badge.label === 'VR180'),
isVr360: video.badges.some(badge => badge.label === '360°'),
is3d: video.badges.some(badge => badge.label === '3D'),
isMemberOnly: video.badges.some(badge => badge.label === 'Members only'),
isMemberFirst: video.badges.some(badge => badge.label === 'Members first'),
hasCaptions: video.has_captions,
hasCaptions: video.has_captions
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/helpers/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ export function updateVideoListAfterProcessing(videos) {
})
}

videoList = videoList.filter(item => {
return !item.isMemberOnly && !item.isMemberFirst
})

videoList.sort((a, b) => {
return b.published - a.published
})
Expand Down
23 changes: 8 additions & 15 deletions src/renderer/views/Channel/Channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1143,9 +1143,7 @@ async function getChannelVideosLocalMore() {
*/
const continuation = await videoContinuationData.value.getContinuation()

latestVideos.value = latestVideos.value.concat(
parseLocalChannelVideos(continuation.videos, id.value, channelName.value)
)
latestVideos.value = latestVideos.value.concat(parseLocalChannelVideos(continuation.videos, id.value, channelName.value))
videoContinuationData.value = continuation.has_continuation ? continuation : null
}
} catch (err) {
Expand Down Expand Up @@ -1422,9 +1420,7 @@ async function getChannelLiveLocalMore() {
*/
const continuation = await liveContinuationData.value.getContinuation()

latestLive.value = latestLive.value.concat(
parseLocalChannelVideos(continuation.videos, id.value, channelName.value)
)
latestLive.value = latestLive.value.concat(parseLocalChannelVideos(continuation.videos, id.value, channelName.value))
liveContinuationData.value = continuation.has_continuation ? continuation : null
} catch (err) {
console.error(err)
Expand Down Expand Up @@ -2051,17 +2047,14 @@ async function searchChannelLocal() {
const results = contents
.filter(node => node.type === 'ItemSection')
.flatMap(itemSection => itemSection.contents)
.reduce((items, item) => {
.filter(item => item.type === 'Video' || (!hideChannelPlaylists.value && item.type === 'Playlist'))
.map(item => {
if (item.type === 'Video') {
const video = parseLocalListVideo(item)
if (video.isMemberOnly || video.isMemberFirst) { return null }

items.push(video)
} else if (!hideChannelPlaylists.value && item.type === 'Playlist') {
items.push(parseLocalListPlaylist(item, id.value, channelName.value))
return parseLocalListVideo(item)
} else {
return parseLocalListPlaylist(item, id.value, channelName.value)
}
return items
}, [])
})

if (isNewSearch) {
searchResults.value = results
Expand Down
16 changes: 2 additions & 14 deletions src/renderer/views/Hashtag/Hashtag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,7 @@ async function getInvidiousHashtag(page = 1) {
async function getLocalHashtag() {
try {
const hashtagData = await getHashtagLocal(hashtag.value)
videos.value = hashtagData.videos.reduce((results, video) => {
const v = parseLocalListVideo(video)
if (v.isMemberOnly || v.isMemberFirst) {
results.push(v)
}
return results
}, [])
videos.value = hashtagData.videos.map((video) => parseLocalListVideo(video))
apiUsed.value = 'local'
hashtagContinuationData.value = hashtagData.has_continuation ? hashtagData : null
isLoading.value = false
Expand All @@ -177,13 +171,7 @@ async function getLocalHashtag() {
async function getLocalHashtagMore() {
try {
const continuation = await hashtagContinuationData.value.getContinuation()
const newVideos = continuation.videos.reduce((results, video) => {
const v = parseLocalListVideo(video)
if (v.isMemberOnly || v.isMemberFirst) {
results.push(v)
}
return results
}, [])
const newVideos = continuation.videos.map((video) => parseLocalListVideo(video))
hashtagContinuationData.value = continuation.has_continuation ? continuation : null
videos.value = videos.value.concat(newVideos)
} catch (error) {
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -1712,8 +1712,7 @@ export default defineComponent({
isHiddenVideo: function (forbiddenTitles, channelsHidden, video) {
return channelsHidden.some(ch => ch.name === video.authorId) ||
channelsHidden.some(ch => ch.name === video.author) ||
forbiddenTitles.some((text) => video.title?.toLowerCase().includes(text.toLowerCase())) ||
(video.isMemberOnly || video.isMemberFirst)
forbiddenTitles.some((text) => video.title?.toLowerCase().includes(text.toLowerCase()))
},

toggleAutoplay: function() {
Expand Down