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.
This commit is contained in:
LuanRT
2022-09-17 19:14:46 -03:00
committed by GitHub
parent a90f5eb853
commit dcf2b720a0
7 changed files with 56 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import Parser from '../index';
import Text from './misc/Text';
import NavigationEndpoint from './NavigationEndpoint';
import SubscriptionNotificationToggleButton from './SubscriptionNotificationToggleButton';
import { YTNode } from '../helpers';
class SubscribeButton extends YTNode {
@@ -14,7 +15,7 @@ class SubscribeButton extends YTNode {
show_preferences: boolean;
subscribed_text: Text;
unsubscribed_text: Text;
notification_preference_button;
notification_preference_button: SubscriptionNotificationToggleButton | null;
endpoint: NavigationEndpoint;
constructor(data: any) {
@@ -27,7 +28,7 @@ class SubscribeButton extends YTNode {
this.show_preferences = data.showPreferences;
this.subscribed_text = new Text(data.subscribedButtonText);
this.unsubscribed_text = new Text(data.unsubscribedButtonText);
this.notification_preference_button = Parser.parse(data.notificationPreferenceButton);
this.notification_preference_button = Parser.parseItem<SubscriptionNotificationToggleButton>(data.notificationPreferenceButton, SubscriptionNotificationToggleButton);
this.endpoint = new NavigationEndpoint(data.serviceEndpoints?.[0] || data.onSubscribeEndpoints?.[0]);
}
}