From dcf2b720a09c82a1ad93815d338c0490c84d0da5 Mon Sep 17 00:00:00 2001 From: LuanRT Date: Sat, 17 Sep 2022 19:14:46 -0300 Subject: [PATCH] fix: minor parsing issues and other improvements (#194) * feat: add `ConfirmDialog` This usually appears in the `playability_status` object. * fix(PlayerErrorMessage): check if `iconType` exists before parsing * chore(parser): fix a few inconsistencies * feat(ytmusic): add `MetadataScreen` TODO: Check TrackInfo, YouTube Music is probably getting some minor UI updates. --- src/parser/classes/ConfirmDialog.ts | 24 ++++++++++++++++++++++++ src/parser/classes/MetadataScreen.ts | 15 +++++++++++++++ src/parser/classes/PlayerErrorMessage.ts | 10 ++++++---- src/parser/classes/SubscribeButton.ts | 5 +++-- src/parser/classes/VideoSecondaryInfo.ts | 5 +++-- src/parser/index.ts | 2 +- src/parser/map.ts | 4 ++++ 7 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 src/parser/classes/ConfirmDialog.ts create mode 100644 src/parser/classes/MetadataScreen.ts diff --git a/src/parser/classes/ConfirmDialog.ts b/src/parser/classes/ConfirmDialog.ts new file mode 100644 index 00000000..4725e2d8 --- /dev/null +++ b/src/parser/classes/ConfirmDialog.ts @@ -0,0 +1,24 @@ +import Parser from '..'; +import Text from './misc/Text'; +import Button from './Button'; + +import { YTNode } from '../helpers'; + +class ConfirmDialog extends YTNode { + static type = 'ConfirmDialog'; + + title: Text; + confirm_button: Button | null; + cancel_button: Button | null; + dialog_messages: Text[]; + + constructor (data: any) { + super(); + this.title = new Text(data.title); + this.confirm_button = Parser.parseItem