Skip to content

Commit bf0c857

Browse files
Channels: Add support for release and podcast tab (local)
1 parent 13e18a8 commit bf0c857

File tree

10 files changed

+293
-29
lines changed

10 files changed

+293
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"vue-router": "^3.6.5",
7979
"vue-tiny-slider": "^0.1.39",
8080
"vuex": "^3.6.2",
81-
"youtubei.js": "^5.2.1"
81+
"youtubei.js": "^5.4.0"
8282
},
8383
"devDependencies": {
8484
"@babel/core": "^7.22.8",

src/renderer/components/distraction-settings/distraction-settings.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ export default defineComponent({
7171
hideChannelPlaylists: function() {
7272
return this.$store.getters.getHideChannelPlaylists
7373
},
74+
hideChannelPodcasts: function() {
75+
return this.$store.getters.getHideChannelPodcasts
76+
},
77+
hideChannelReleases: function() {
78+
return this.$store.getters.getHideChannelReleases
79+
},
7480
hideChannelCommunity: function() {
7581
return this.$store.getters.getHideChannelCommunity
7682
},
@@ -117,7 +123,9 @@ export default defineComponent({
117123
'updateHideFeaturedChannels',
118124
'updateHideChannelShorts',
119125
'updateHideChannelPlaylists',
120-
'updateHideChannelCommunity'
126+
'updateHideChannelCommunity',
127+
'updateHideChannelPodcasts',
128+
'updateHideChannelReleases'
121129
])
122130
}
123131
})

src/renderer/components/distraction-settings/distraction-settings.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
:default-value="hideChannelPlaylists"
5757
@change="updateHideChannelPlaylists"
5858
/>
59+
<ft-toggle-switch
60+
:label="$t('Settings.Distraction Free Settings.Hide Channel Podcasts')"
61+
:compact="true"
62+
:default-value="hideChannelPodcasts"
63+
@change="updateHideChannelPodcasts"
64+
/>
5965
</div>
6066
<div class="switchColumn">
6167
<ft-toggle-switch
@@ -70,6 +76,12 @@
7076
:default-value="hideFeaturedChannels"
7177
@change="updateHideFeaturedChannels"
7278
/>
79+
<ft-toggle-switch
80+
:label="$t('Settings.Distraction Free Settings.Hide Channel Releases')"
81+
:compact="true"
82+
:default-value="hideChannelReleases"
83+
@change="updateHideChannelReleases"
84+
/>
7385
</div>
7486
</div>
7587
<h4

src/renderer/helpers/api/local.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ export function parseLocalListPlaylist(playlist, author = undefined) {
363363
let channelId = null
364364
/** @type {import('youtubei.js').YTNodes.PlaylistVideoThumbnail} */
365365
const thumbnailRenderer = playlist.thumbnail_renderer
366-
367-
if (playlist.author) {
366+
if (playlist.author && playlist.author.id !== 'N/A') {
368367
if (playlist.author instanceof Misc.Text) {
369368
channelName = playlist.author.text
370369

src/renderer/store/modules/settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ const state = {
194194
hideActiveSubscriptions: false,
195195
hideChannelCommunity: false,
196196
hideChannelPlaylists: false,
197+
hideChannelReleases: false,
198+
hideChannelPodcasts: false,
197199
hideChannelShorts: false,
198200
hideChannelSubscriptions: false,
199201
hideCommentLikes: false,

src/renderer/store/modules/utils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ const actions = {
317317
let urlType = 'unknown'
318318

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

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

@@ -439,6 +439,12 @@ const actions = {
439439
case 'playlists':
440440
subPath = 'playlists'
441441
break
442+
case 'podcasts':
443+
subPath = 'podcasts'
444+
break
445+
case 'releases':
446+
subPath = 'releases'
447+
break
442448
case 'channels':
443449
case 'about':
444450
subPath = 'about'

0 commit comments

Comments
 (0)