Use sequelize scopes

This commit is contained in:
Chocobozzz
2017-12-14 10:07:57 +01:00
parent 94edfc3b2a
commit d48ff09d27
13 changed files with 264 additions and 312 deletions

View File

@@ -58,6 +58,7 @@ 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

View File

@@ -22,7 +22,6 @@ export class Video implements VideoServerModel {
isLocal: boolean
name: string
serverHost: string
tags: string[]
thumbnailPath: string
thumbnailUrl: string
previewPath: string
@@ -71,7 +70,6 @@ export class Video implements VideoServerModel {
this.isLocal = hash.isLocal
this.name = hash.name
this.serverHost = hash.serverHost
this.tags = hash.tags
this.thumbnailPath = hash.thumbnailPath
this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath
this.previewPath = hash.previewPath