feat new properties
This commit is contained in:
parent
497b1aa61d
commit
415c0c0f2c
@ -37,8 +37,8 @@ export class Video {
|
|||||||
url? : string;
|
url? : string;
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
durationFormatted: string;
|
durationRaw: string;
|
||||||
duration: number;
|
durationInSec: number;
|
||||||
uploadedAt?: string;
|
uploadedAt?: string;
|
||||||
views: number;
|
views: number;
|
||||||
thumbnail?: Thumbnail;
|
thumbnail?: Thumbnail;
|
||||||
@ -57,8 +57,8 @@ export class Video {
|
|||||||
this.url = `https://www.youtube.com/watch?v=${this.id}`
|
this.url = `https://www.youtube.com/watch?v=${this.id}`
|
||||||
this.title = data.title || undefined;
|
this.title = data.title || undefined;
|
||||||
this.description = data.description || undefined;
|
this.description = data.description || undefined;
|
||||||
this.durationFormatted = data.duration_raw || "0:00";
|
this.durationRaw = data.duration_raw || "0:00";
|
||||||
this.duration = (data.duration < 0 ? 0 : data.duration) || 0;
|
this.durationInSec = (data.duration < 0 ? 0 : data.duration) || 0;
|
||||||
this.uploadedAt = data.uploadedAt || undefined;
|
this.uploadedAt = data.uploadedAt || undefined;
|
||||||
this.views = parseInt(data.views) || 0;
|
this.views = parseInt(data.views) || 0;
|
||||||
this.thumbnail = data.thumbnail || {};
|
this.thumbnail = data.thumbnail || {};
|
||||||
@ -84,8 +84,8 @@ export class Video {
|
|||||||
url: this.url,
|
url: this.url,
|
||||||
title: this.title,
|
title: this.title,
|
||||||
description: this.description,
|
description: this.description,
|
||||||
durationInSec: this.duration,
|
durationInSec: this.durationInSec,
|
||||||
durationRaw: this.durationFormatted,
|
durationRaw: this.durationRaw,
|
||||||
uploadedAt: this.uploadedAt,
|
uploadedAt: this.uploadedAt,
|
||||||
thumbnail: this.thumbnail?.toJSON(),
|
thumbnail: this.thumbnail?.toJSON(),
|
||||||
channel: {
|
channel: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user