diff --git a/src/core/Feed.ts b/src/core/Feed.ts index 4ad4bab6..cde6e091 100644 --- a/src/core/Feed.ts +++ b/src/core/Feed.ts @@ -30,7 +30,7 @@ import type MusicQueue from '../parser/classes/MusicQueue.js'; import type RichGrid from '../parser/classes/RichGrid.js'; import type SectionList from '../parser/classes/SectionList.js'; -import type { IParsedResponse } from '../parser/types/ParsedResponse.js'; +import type { IParsedResponse } from '../parser/types/index.js'; import type { ApiResponse } from './Actions.js'; class Feed { @@ -125,9 +125,9 @@ class Feed { * Returns contents from the page. */ get page_contents(): SectionList | MusicQueue | RichGrid | ReloadContinuationItemsCommand { - const tab_content = this.#memo.getType(Tab)?.[0]?.content; - const reload_continuation_items = this.#memo.getType(ReloadContinuationItemsCommand)?.[0]; - const append_continuation_items = this.#memo.getType(AppendContinuationItemsAction)?.[0]; + const tab_content = this.#memo.getType(Tab)?.first().content; + const reload_continuation_items = this.#memo.getType(ReloadContinuationItemsCommand).first(); + const append_continuation_items = this.#memo.getType(AppendContinuationItemsAction).first(); return tab_content || reload_continuation_items || append_continuation_items; } diff --git a/src/parser/youtube/Channel.ts b/src/parser/youtube/Channel.ts index aaec4ac7..cfa1ae7c 100644 --- a/src/parser/youtube/Channel.ts +++ b/src/parser/youtube/Channel.ts @@ -22,7 +22,7 @@ import { ChannelError, InnertubeError } from '../../utils/Utils.js'; import type { AppendContinuationItemsAction, ReloadContinuationItemsCommand } from '../index.js'; import type Actions from '../../core/Actions.js'; import type { ApiResponse } from '../../core/Actions.js'; -import type { IBrowseResponse } from '../types/ParsedResponse.js'; +import type { IBrowseResponse } from '../types/index.js'; export default class Channel extends TabbedFeed { header?: C4TabbedHeader | CarouselHeader | InteractiveTabbedHeader; @@ -179,7 +179,7 @@ export default class Channel extends TabbedFeed { } /** - * Retrieves the channel about page. + * Retrieves the about page. * Note that this does not return a new {@link Channel} object. */ async getAbout(): Promise { @@ -249,13 +249,13 @@ export default class Channel extends TabbedFeed { } export class ChannelListContinuation extends Feed { - contents: ReloadContinuationItemsCommand | AppendContinuationItemsAction | undefined; + contents?: ReloadContinuationItemsCommand | AppendContinuationItemsAction; constructor(actions: Actions, data: ApiResponse | IBrowseResponse, already_parsed = false) { super(actions, data, already_parsed); this.contents = - this.page.on_response_received_actions?.[0] || - this.page.on_response_received_endpoints?.[0]; + this.page.on_response_received_actions.first() || + this.page.on_response_received_endpoints?.first(); } /**