]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video-details.model.ts
Redirect to uuid video route after upload
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-details.model.ts
index 1a956da7cb96ba246cd1acd37927fdf7f165c67a..8243b9f1ca064ed3a3c64354da368547a8e79294 100644 (file)
@@ -1,4 +1,4 @@
-import { Account } from '../../../../../shared/models/accounts'
+import { Account } from '../../../../../shared/models/actors'
 import { Video } from '../../shared/video/video.model'
 import { AuthUser } from '../../core'
 import {
@@ -46,6 +46,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
   privacy: VideoPrivacy
   privacyLabel: string
   account: Account
+  likesPercent: number
+  dislikesPercent: number
 
   constructor (hash: VideoDetailsServerModel) {
     super(hash)
@@ -56,6 +58,10 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
     this.files = hash.files
     this.channel = hash.channel
     this.account = hash.account
+    this.tags = hash.tags
+
+    this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100
+    this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100
   }
 
   getAppropriateMagnetUri (actualDownloadSpeed = 0) {