Skip to content

Commit

Permalink
chore(parser)!: Remove getters that have been deprecated for a long t…
Browse files Browse the repository at this point in the history
…ime (#815)
  • Loading branch information
absidue authored Nov 21, 2024
1 parent 7397aa3 commit 9cf0d3f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 78 deletions.
21 changes: 0 additions & 21 deletions src/parser/classes/Channel.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
}
}
21 changes: 0 additions & 21 deletions src/parser/classes/ChannelAboutFullMetadata.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
}
}
21 changes: 0 additions & 21 deletions src/parser/classes/ChannelVideoPlayer.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
}
}
15 changes: 0 additions & 15 deletions src/parser/ytmusic/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9cf0d3f

Please sign in to comment.