Files
YouTube.js/src/parser/classes/ChannelVideoPlayer.ts
Luan e86a0daf45 refactor(general): Clean up and add a logger (#587)
* feat(utils): Add logger

* chore: Clean up some classes and add more logging

* chore: Fix conflicts
2024-01-25 19:01:28 -03:00

43 lines
1.3 KiB
TypeScript

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';
id: string;
title: Text;
description: Text;
view_count: Text;
published_time: Text;
constructor(data: RawNode) {
super();
this.id = data.videoId;
this.title = new Text(data.title);
this.description = new Text(data.description);
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;
}
}