13 thumbnailPath: string;
15 private static createByString(author: string, podHost: string) {
16 return author + '@' + podHost;
19 private static createDurationString(duration: number) {
20 const minutes = Math.floor(duration / 60);
21 const seconds = duration % 60;
22 const minutes_padding = minutes >= 10 ? '' : '0';
23 const seconds_padding = seconds >= 10 ? '' : '0';
25 return minutes_padding + minutes.toString() + ':' + seconds_padding + seconds.toString();
41 this.author = hash.author;
42 this.createdDate = new Date(hash.createdDate);
43 this.description = hash.description;
44 this.duration = Video.createDurationString(hash.duration);
46 this.isLocal = hash.isLocal;
47 this.magnetUri = hash.magnetUri;
48 this.name = hash.name;
49 this.podHost = hash.podHost;
50 this.tags = hash.tags;
51 this.thumbnailPath = hash.thumbnailPath;
53 this.by = Video.createByString(hash.author, hash.podHost);
57 return this.isLocal === true && user && this.author === user.username;