Fix YouTubeVideo JSON serialisation
This commit is contained in:
parent
4c8162ecdd
commit
9c002e210c
@ -15,11 +15,7 @@ interface VideoOptions {
|
||||
height: number | undefined;
|
||||
url: string | undefined;
|
||||
};
|
||||
channel?: {
|
||||
name: string;
|
||||
id: string;
|
||||
icon: string;
|
||||
};
|
||||
channel?: any;
|
||||
type: string;
|
||||
ratings: {
|
||||
likes: number;
|
||||
@ -68,7 +64,7 @@ export class YouTubeVideo {
|
||||
this.uploadedAt = data.uploadedAt || undefined;
|
||||
this.views = parseInt(data.views) || 0;
|
||||
this.thumbnail = data.thumbnail || {};
|
||||
this.channel = data.channel || {};
|
||||
this.channel = new YouTubeChannel(data.channel) || {};
|
||||
this.likes = (data.ratings?.likes as number) || 0;
|
||||
this.dislikes = data.ratings?.dislikes || 0;
|
||||
this.live = !!data.live;
|
||||
@ -90,11 +86,7 @@ export class YouTubeVideo {
|
||||
durationRaw: this.durationRaw,
|
||||
uploadedAt: this.uploadedAt,
|
||||
thumbnail: this.thumbnail,
|
||||
channel: {
|
||||
name: this.channel?.name as string,
|
||||
id: this.channel?.id as string,
|
||||
icon: this.channel?.iconURL() as string
|
||||
},
|
||||
channel: this.channel,
|
||||
views: this.views,
|
||||
type: this.type,
|
||||
tags: this.tags,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user