mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-13 01:22:11 +00:00
chore(parser)!: Remove getters that have been deprecated for a long time (#815)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { Log } from '../../utils/index.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import { Parser, type RawNode } from '../index.js';
|
||||
import Button from './Button.js';
|
||||
@@ -38,24 +37,4 @@ export default class Channel extends YTNode {
|
||||
this.subscribe_button = Parser.parseItem(data.subscribeButton, [ SubscribeButton, Button ]);
|
||||
this.description_snippet = new Text(data.descriptionSnippet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This will be removed in a future release.
|
||||
* Please use {@link Channel.subscriber_count} instead.
|
||||
*/
|
||||
get subscribers(): Text {
|
||||
Log.warnOnce(Channel.type, 'Channel#subscribers is deprecated. Please use Channel#subscriber_count instead.');
|
||||
return this.subscriber_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This will be removed in a future release.
|
||||
* Please use {@link Channel.video_count} instead.
|
||||
*/
|
||||
get videos(): Text {
|
||||
Log.warnOnce(Channel.type, 'Channel#videos is deprecated. Please use Channel#video_count instead.');
|
||||
return this.video_count;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Log } from '../../utils/index.js';
|
||||
import { YTNode, type ObservedArray } from '../helpers.js';
|
||||
import { Parser, type RawNode } from '../index.js';
|
||||
import Button from './Button.js';
|
||||
@@ -49,24 +48,4 @@ export default class ChannelAboutFullMetadata extends YTNode {
|
||||
this.country = new Text(data.country);
|
||||
this.buttons = Parser.parseArray(data.actionButtons, Button);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This will be removed in a future release.
|
||||
* Please use {@link ChannelAboutFullMetadata.view_count} instead.
|
||||
*/
|
||||
get views() {
|
||||
Log.warnOnce(ChannelAboutFullMetadata.type, 'ChannelAboutFullMetadata#views is deprecated. Please use ChannelAboutFullMetadata#view_count instead.');
|
||||
return this.view_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This will be removed in a future release.
|
||||
* Please use {@link ChannelAboutFullMetadata.joined_date} instead.
|
||||
*/
|
||||
get joined(): Text {
|
||||
Log.warnOnce(ChannelAboutFullMetadata.type, 'ChannelAboutFullMetadata#joined is deprecated. Please use ChannelAboutFullMetadata#joined_date instead.');
|
||||
return this.joined_date;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import Text from './misc/Text.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
import { Log } from '../../utils/index.js';
|
||||
|
||||
export default class ChannelVideoPlayer extends YTNode {
|
||||
static type = 'ChannelVideoPlayer';
|
||||
@@ -20,24 +19,4 @@ export default class ChannelVideoPlayer extends YTNode {
|
||||
this.view_count = new Text(data.viewCountText);
|
||||
this.published_time = new Text(data.publishedTimeText);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This will be removed in a future release.
|
||||
* Please use {@link ChannelVideoPlayer.view_count} instead.
|
||||
*/
|
||||
get views(): Text {
|
||||
Log.warnOnce(ChannelVideoPlayer.type, 'ChannelVideoPlayer#views is deprecated. Please use ChannelVideoPlayer#view_count instead.');
|
||||
return this.view_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This will be removed in a future release.
|
||||
* Please use {@link ChannelVideoPlayer.published_time} instead.
|
||||
*/
|
||||
get published(): Text {
|
||||
Log.warnOnce(ChannelVideoPlayer.type, 'ChannelVideoPlayer#published is deprecated. Please use ChannelVideoPlayer#published_time instead.');
|
||||
return this.published_time;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import TabbedSearchResults from '../classes/TabbedSearchResults.js';
|
||||
import type { ObservedArray } from '../helpers.js';
|
||||
import type { ISearchResponse } from '../types/ParsedResponse.js';
|
||||
import type { ApiResponse, Actions } from '../../core/index.js';
|
||||
import type MusicResponsiveListItem from '../classes/MusicResponsiveListItem.js';
|
||||
|
||||
export default class Search {
|
||||
#page: ISearchResponse;
|
||||
@@ -147,20 +146,6 @@ export default class Search {
|
||||
return this.contents?.filterType(MusicShelf).find((section) => section.title.toString() === 'Community playlists');
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Search.contents} instead.
|
||||
*/
|
||||
get results(): ObservedArray<MusicResponsiveListItem> | undefined {
|
||||
return this.contents?.firstOfType(MusicShelf)?.contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Search.contents} instead.
|
||||
*/
|
||||
get sections(): ObservedArray<MusicShelf> | undefined {
|
||||
return this.contents?.filterType(MusicShelf);
|
||||
}
|
||||
|
||||
get page(): ISearchResponse {
|
||||
return this.#page;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user