mirror of https://github.com/FreeTubeApp/FreeTube
Fix playlists not showing up on artist topic channels with the local API (#4129)
This commit is contained in:
parent
23f8fac87b
commit
05499ce113
|
@ -1191,13 +1191,20 @@ export default defineComponent({
|
||||||
// for the moment we just want the "Created Playlists" category that has all playlists in it
|
// for the moment we just want the "Created Playlists" category that has all playlists in it
|
||||||
|
|
||||||
if (playlistsTab.content_type_filters.length > 1) {
|
if (playlistsTab.content_type_filters.length > 1) {
|
||||||
|
let viewId = '1'
|
||||||
|
|
||||||
|
// Artist topic channels don't have any created playlists, so we went to select the "Albums & Singles" category instead
|
||||||
|
if (this.channelName.endsWith('- Topic') && channel.metadata.music_artist_name) {
|
||||||
|
viewId = '50'
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {import('youtubei.js').YTNodes.ChannelSubMenu}
|
* @type {import('youtubei.js').YTNodes.ChannelSubMenu}
|
||||||
*/
|
*/
|
||||||
const menu = playlistsTab.current_tab.content.sub_menu
|
const menu = playlistsTab.current_tab.content.sub_menu
|
||||||
const createdPlaylistsFilter = menu.content_type_sub_menu_items.find(contentType => {
|
const createdPlaylistsFilter = menu.content_type_sub_menu_items.find(contentType => {
|
||||||
const url = `https://youtube.com/${contentType.endpoint.metadata.url}`
|
const url = `https://youtube.com/${contentType.endpoint.metadata.url}`
|
||||||
return new URL(url).searchParams.get('view') === '1'
|
return new URL(url).searchParams.get('view') === viewId
|
||||||
}).title
|
}).title
|
||||||
|
|
||||||
playlistsTab = await playlistsTab.applyContentTypeFilter(createdPlaylistsFilter)
|
playlistsTab = await playlistsTab.applyContentTypeFilter(createdPlaylistsFilter)
|
||||||
|
|
Loading…
Reference in New Issue