author: string;
by: string;
createdAt: Date;
+ categoryLabel: string;
+ licenceLabel: string;
description: string;
duration: string;
id: string;
podHost: string;
tags: string[];
thumbnailPath: string;
+ views: number;
+ likes: number;
+ dislikes: number;
private static createByString(author: string, podHost: string) {
return author + '@' + podHost;
constructor(hash: {
author: string,
createdAt: string,
+ categoryLabel: string,
+ licenceLabel: string,
description: string,
duration: number;
id: string,
name: string,
podHost: string,
tags: string[],
- thumbnailPath: string
+ thumbnailPath: string,
+ views: number,
+ likes: number,
+ dislikes: number,
}) {
this.author = hash.author;
this.createdAt = new Date(hash.createdAt);
+ this.categoryLabel = hash.categoryLabel;
+ this.licenceLabel = hash.licenceLabel;
this.description = hash.description;
this.duration = Video.createDurationString(hash.duration);
this.id = hash.id;
this.podHost = hash.podHost;
this.tags = hash.tags;
this.thumbnailPath = hash.thumbnailPath;
+ this.views = hash.views;
+ this.likes = hash.likes;
+ this.dislikes = hash.dislikes;
this.by = Video.createByString(hash.author, hash.podHost);
}