-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Cookie-based session fixes and minor additions (#821)
* (fix) `on_behalf_of_user` arg not applied * (feat) `AccountManager#getInfo()`: Add option to fetch full accounts list
- Loading branch information
1 parent
386257c
commit a7bb981
Showing
7 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import { Parser, type RawNode } from '../index.js'; | ||
import { Text } from '../misc.js'; | ||
import Button from './Button.js'; | ||
|
||
export default class ChannelSwitcherHeader extends YTNode { | ||
static type = 'ChannelSwitcherHeader'; | ||
|
||
title: string; | ||
button?: Button | null; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.title = new Text(data.title).toString(); | ||
|
||
if (Reflect.has(data, 'button')) { | ||
this.button = Parser.parseItem(data.button, Button); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { ObservedArray } from '../helpers.js'; | ||
import { YTNode } from '../helpers.js'; | ||
import { Parser, type RawNode } from '../index.js'; | ||
|
||
export default class ChannelSwitcherPage extends YTNode { | ||
static type = 'ChannelSwitcherPage'; | ||
|
||
header: YTNode; | ||
contents: ObservedArray<YTNode> | null; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.header = Parser.parseItem(data.header); | ||
this.contents = Parser.parse(data.contents, true); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/parser/classes/actions/UpdateChannelSwitcherPageAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ObservedArray } from '../../helpers.js'; | ||
import { YTNode } from '../../helpers.js'; | ||
import { Parser, type RawNode } from '../../index.js'; | ||
import ChannelSwitcherPage from '../ChannelSwitcherPage.js'; | ||
|
||
export default class UpdateChannelSwitcherPageAction extends YTNode { | ||
static type = 'UpdateChannelSwitcherPageAction'; | ||
|
||
public header?: YTNode; | ||
public contents?: ObservedArray<YTNode> | null; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
const page = Parser.parseItem(data.page, ChannelSwitcherPage); | ||
if (page) { | ||
this.header = page.header; | ||
this.contents = page.contents; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters