export class Video {
author: string;
by: string;
- createdDate: Date;
+ createdAt: Date;
description: string;
duration: string;
id: string;
podHost: string;
tags: string[];
thumbnailPath: string;
+ views: number;
private static createByString(author: string, podHost: string) {
return author + '@' + podHost;
constructor(hash: {
author: string,
- createdDate: string,
+ createdAt: string,
description: string,
duration: number;
id: string,
name: string,
podHost: string,
tags: string[],
- thumbnailPath: string
+ thumbnailPath: string,
+ views: number
}) {
this.author = hash.author;
- this.createdDate = new Date(hash.createdDate);
+ this.createdAt = new Date(hash.createdAt);
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.by = Video.createByString(hash.author, hash.podHost);
}