From 9cf0d3f3b3099af3dd59bc4ca99fefe217a91020 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:13:37 +0100 Subject: [PATCH] chore(parser)!: Remove getters that have been deprecated for a long time (#815) --- src/parser/classes/Channel.ts | 21 ------------------- .../classes/ChannelAboutFullMetadata.ts | 21 ------------------- src/parser/classes/ChannelVideoPlayer.ts | 21 ------------------- src/parser/ytmusic/Search.ts | 15 ------------- 4 files changed, 78 deletions(-) diff --git a/src/parser/classes/Channel.ts b/src/parser/classes/Channel.ts index d1a236eac..199ef7a71 100644 --- a/src/parser/classes/Channel.ts +++ b/src/parser/classes/Channel.ts @@ -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; - } } \ No newline at end of file diff --git a/src/parser/classes/ChannelAboutFullMetadata.ts b/src/parser/classes/ChannelAboutFullMetadata.ts index 6be97768a..679656273 100644 --- a/src/parser/classes/ChannelAboutFullMetadata.ts +++ b/src/parser/classes/ChannelAboutFullMetadata.ts @@ -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; - } } \ No newline at end of file diff --git a/src/parser/classes/ChannelVideoPlayer.ts b/src/parser/classes/ChannelVideoPlayer.ts index d59cdb66f..fc25889e5 100644 --- a/src/parser/classes/ChannelVideoPlayer.ts +++ b/src/parser/classes/ChannelVideoPlayer.ts @@ -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; - } } \ No newline at end of file diff --git a/src/parser/ytmusic/Search.ts b/src/parser/ytmusic/Search.ts index 759b66e47..cf2540188 100644 --- a/src/parser/ytmusic/Search.ts +++ b/src/parser/ytmusic/Search.ts @@ -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 | undefined { - return this.contents?.firstOfType(MusicShelf)?.contents; - } - - /** - * @deprecated Use {@link Search.contents} instead. - */ - get sections(): ObservedArray | undefined { - return this.contents?.filterType(MusicShelf); - } - get page(): ISearchResponse { return this.#page; }