mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 20:41:17 +00:00
style: lint and format
This commit is contained in:
@@ -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<T extends IParsedResponse = IParsedResponse> {
|
||||
@@ -125,9 +125,9 @@ class Feed<T extends IParsedResponse = IParsedResponse> {
|
||||
* 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;
|
||||
}
|
||||
|
||||
@@ -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<IBrowseResponse> {
|
||||
header?: C4TabbedHeader | CarouselHeader | InteractiveTabbedHeader;
|
||||
@@ -179,7 +179,7 @@ export default class Channel extends TabbedFeed<IBrowseResponse> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the channel about page.
|
||||
* Retrieves the about page.
|
||||
* Note that this does not return a new {@link Channel} object.
|
||||
*/
|
||||
async getAbout(): Promise<ChannelAboutFullMetadata> {
|
||||
@@ -249,13 +249,13 @@ export default class Channel extends TabbedFeed<IBrowseResponse> {
|
||||
}
|
||||
|
||||
export class ChannelListContinuation extends Feed<IBrowseResponse> {
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user