refactor(parser): fix many minor inconsistencies

This commit is contained in:
LuanRT
2023-03-15 06:43:04 -03:00
parent 1a2fc3abd7
commit 3d3436472f
35 changed files with 144 additions and 144 deletions

View File

@@ -1,9 +1,9 @@
import Parser from '../index.js';
import Text from './misc/Text.js';
import { YTNode } from '../helpers.js';
import Parser, { RawNode } from '../index.js';
import Author from './misc/Author.js';
import Text from './misc/Text.js';
import Thumbnail from './misc/Thumbnail.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import { YTNode } from '../helpers.js';
class EndScreenVideo extends YTNode {
static type = 'EndScreenVideo';
@@ -22,12 +22,12 @@ class EndScreenVideo extends YTNode {
seconds: number;
};
constructor(data: any) {
constructor(data: RawNode) {
super();
this.id = data.videoId;
this.title = new Text(data.title);
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.thumbnail_overlays = Parser.parse(data.thumbnailOverlays);
this.thumbnail_overlays = Parser.parseArray(data.thumbnailOverlays);
this.author = new Author(data.shortBylineText, data.ownerBadges);
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.short_view_count = new Text(data.shortViewCountText);