Skip to content

Commit

Permalink
Channels: Add support for release and podcast tab (#3778)
Browse files Browse the repository at this point in the history
* Channels: Add support for release and podcast tab (local)

* Add support for releases and podcasts tab (Invidious API)

* add urls with has_url

* Fix copy paste error

Co-Authored-By: absidue <48293849+absidue@users.noreply.github.com>

---------

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
  • Loading branch information
ChunkyProgrammer and absidue authored Jul 19, 2023
1 parent 18b758f commit 095568e
Show file tree
Hide file tree
Showing 8 changed files with 444 additions and 28 deletions.
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

0 comments on commit 095568e

Please sign in to comment.