mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 00:56:23 +00:00
feat(ytmusic): implement music#Library (#136)
* feat: add ItemSectionTab and related parsers * feat: add `continuation` to `Grid`parser class * feat (ytmusic): implement music#getLibrary() * Improve album fetch in `MusicResponsiveListItem` * music#Library: return [] for empty results * feat: add `Dropdown` & `DropdownItem` parsers * feat: add `CreatePlaylistDialog` parser * feat: add `create_playlist` to NavigationEndpoint * feat: add `AutomixPreviewVideo` parser * feat: improve parsing of items * fix: `PlaylistPanel` continuation * feat: more args in `Actions#next` * feat: add `PlaylistPanelContinuation` to `Parser` * chore: update parser-map * music#Library: refactor + add shuffle songs opt * feat: add `endpoint` to `DropdownItem` * feat: add `end_items` to `ItemSectionTabbedHeader` * feat(ytmusic): add `sort_by` to `music#Library`
This commit is contained in:
27
src/parser/classes/CreatePlaylistDialog.ts
Normal file
27
src/parser/classes/CreatePlaylistDialog.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import Parser from '..';
|
||||
import { ObservedArray, YTNode } from '../helpers';
|
||||
import Button from './Button';
|
||||
import Dropdown from './Dropdown';
|
||||
import DropdownItem from './DropdownItem';
|
||||
import Text from './misc/Text';
|
||||
|
||||
class CreatePlaylistDialog extends YTNode {
|
||||
static type = 'CreatePlaylistDialog';
|
||||
|
||||
title: string;
|
||||
title_placeholder: string;
|
||||
privacy_option: ObservedArray<DropdownItem> | null;
|
||||
cancel_button: Button | null;
|
||||
create_button: Button | null;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.title = new Text(data.dialogTitle).toString();
|
||||
this.title_placeholder = data.titlePlaceholder || '';
|
||||
this.privacy_option = Parser.parseItem(data.privacyOption, Dropdown)?.entries || null;
|
||||
this.create_button = Parser.parseItem(data.cancelButton);
|
||||
this.cancel_button = Parser.parseItem(data.cancelButton);
|
||||
}
|
||||
}
|
||||
|
||||
export default CreatePlaylistDialog;
|
||||
Reference in New Issue
Block a user