Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channels: Add support for release and podcast tab #3778

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export default defineComponent({
hideChannelPlaylists: function() {
return this.$store.getters.getHideChannelPlaylists
},
hideChannelPodcasts: function() {
return this.$store.getters.getHideChannelPodcasts
},
hideChannelReleases: function() {
return this.$store.getters.getHideChannelReleases
},
hideChannelCommunity: function() {
return this.$store.getters.getHideChannelCommunity
},
Expand Down Expand Up @@ -117,7 +123,9 @@ export default defineComponent({
'updateHideFeaturedChannels',
'updateHideChannelShorts',
'updateHideChannelPlaylists',
'updateHideChannelCommunity'
'updateHideChannelCommunity',
'updateHideChannelPodcasts',
'updateHideChannelReleases'
])
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
:default-value="hideChannelPlaylists"
@change="updateHideChannelPlaylists"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Channel Podcasts')"
:compact="true"
:default-value="hideChannelPodcasts"
@change="updateHideChannelPodcasts"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
Expand All @@ -70,6 +76,12 @@
:default-value="hideFeaturedChannels"
@change="updateHideFeaturedChannels"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Channel Releases')"
:compact="true"
:default-value="hideChannelReleases"
@change="updateHideChannelReleases"
/>
</div>
</div>
<h4
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,7 @@ export function parseLocalListPlaylist(playlist, author = undefined) {
let channelId = null
/** @type {import('youtubei.js').YTNodes.PlaylistVideoThumbnail} */
const thumbnailRenderer = playlist.thumbnail_renderer

if (playlist.author) {
if (playlist.author && playlist.author.id !== 'N/A') {
if (playlist.author instanceof Misc.Text) {
channelName = playlist.author.text

Expand Down
2 changes: 2 additions & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ const state = {
hideActiveSubscriptions: false,
hideChannelCommunity: false,
hideChannelPlaylists: false,
hideChannelReleases: false,
hideChannelPodcasts: false,
hideChannelShorts: false,
hideChannelSubscriptions: false,
hideCommentLikes: false,
Expand Down
8 changes: 7 additions & 1 deletion src/renderer/store/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ const actions = {
let urlType = 'unknown'

const channelPattern =
/^\/(?:(?:channel|user|c)\/)?(?<channelId>[^/]+)(?:\/(?<tab>join|featured|videos|shorts|live|streams|playlists|about|community|channels))?\/?$/
/^\/(?:(?:channel|user|c)\/)?(?<channelId>[^/]+)(?:\/(?<tab>join|featured|videos|shorts|live|streams|podcasts|releases|playlists|about|community|channels))?\/?$/

const hashtagPattern = /^\/hashtag\/(?<tag>[^#&/?]+)$/

Expand Down Expand Up @@ -439,6 +439,12 @@ const actions = {
case 'playlists':
subPath = 'playlists'
break
case 'podcasts':
subPath = 'podcasts'
break
case 'releases':
subPath = 'releases'
break
case 'channels':
case 'about':
subPath = 'about'
Expand Down
Loading