aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video-abuse-interface.ts6
-rw-r--r--server/models/video/video-abuse.ts6
-rw-r--r--server/models/video/video-blacklist-interface.ts8
-rw-r--r--server/models/video/video-blacklist.ts6
-rw-r--r--server/models/video/video-interface.ts20
-rw-r--r--server/models/video/video.ts6
6 files changed, 26 insertions, 26 deletions
diff --git a/server/models/video/video-abuse-interface.ts b/server/models/video/video-abuse-interface.ts
index fa45aa5f9..abc82f7ac 100644
--- a/server/models/video/video-abuse-interface.ts
+++ b/server/models/video/video-abuse-interface.ts
@@ -5,10 +5,10 @@ import { PodInstance } from '../pod'
5import { ResultList } from '../../../shared' 5import { ResultList } from '../../../shared'
6 6
7// Don't use barrel, import just what we need 7// Don't use barrel, import just what we need
8import { VideoAbuse as FormatedVideoAbuse } from '../../../shared/models/videos/video-abuse.model' 8import { VideoAbuse as FormattedVideoAbuse } from '../../../shared/models/videos/video-abuse.model'
9 9
10export namespace VideoAbuseMethods { 10export namespace VideoAbuseMethods {
11 export type ToFormatedJSON = (this: VideoAbuseInstance) => FormatedVideoAbuse 11 export type ToFormattedJSON = (this: VideoAbuseInstance) => FormattedVideoAbuse
12 12
13 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoAbuseInstance> > 13 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoAbuseInstance> >
14} 14}
@@ -30,7 +30,7 @@ export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttribute
30 30
31 Pod: PodInstance 31 Pod: PodInstance
32 32
33 toFormatedJSON: VideoAbuseMethods.ToFormatedJSON 33 toFormattedJSON: VideoAbuseMethods.ToFormattedJSON
34} 34}
35 35
36export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> {} 36export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> {}
diff --git a/server/models/video/video-abuse.ts b/server/models/video/video-abuse.ts
index df92609c0..ebc63e7a0 100644
--- a/server/models/video/video-abuse.ts
+++ b/server/models/video/video-abuse.ts
@@ -12,7 +12,7 @@ import {
12} from './video-abuse-interface' 12} from './video-abuse-interface'
13 13
14let VideoAbuse: Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> 14let VideoAbuse: Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes>
15let toFormatedJSON: VideoAbuseMethods.ToFormatedJSON 15let toFormattedJSON: VideoAbuseMethods.ToFormattedJSON
16let listForApi: VideoAbuseMethods.ListForApi 16let listForApi: VideoAbuseMethods.ListForApi
17 17
18export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) { 18export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
@@ -57,7 +57,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
57 listForApi 57 listForApi
58 ] 58 ]
59 const instanceMethods = [ 59 const instanceMethods = [
60 toFormatedJSON 60 toFormattedJSON
61 ] 61 ]
62 addMethodsToModel(VideoAbuse, classMethods, instanceMethods) 62 addMethodsToModel(VideoAbuse, classMethods, instanceMethods)
63 63
@@ -66,7 +66,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
66 66
67// ------------------------------ METHODS ------------------------------ 67// ------------------------------ METHODS ------------------------------
68 68
69toFormatedJSON = function (this: VideoAbuseInstance) { 69toFormattedJSON = function (this: VideoAbuseInstance) {
70 let reporterPodHost 70 let reporterPodHost
71 71
72 if (this.Pod) { 72 if (this.Pod) {
diff --git a/server/models/video/video-blacklist-interface.ts b/server/models/video/video-blacklist-interface.ts
index cd9f19363..ba48b1b6e 100644
--- a/server/models/video/video-blacklist-interface.ts
+++ b/server/models/video/video-blacklist-interface.ts
@@ -4,10 +4,10 @@ import * as Promise from 'bluebird'
4import { ResultList } from '../../../shared' 4import { ResultList } from '../../../shared'
5 5
6// Don't use barrel, import just what we need 6// Don't use barrel, import just what we need
7import { BlacklistedVideo as FormatedBlacklistedVideo } from '../../../shared/models/videos/video-blacklist.model' 7import { BlacklistedVideo as FormattedBlacklistedVideo } from '../../../shared/models/videos/video-blacklist.model'
8 8
9export namespace BlacklistedVideoMethods { 9export namespace BlacklistedVideoMethods {
10 export type ToFormatedJSON = (this: BlacklistedVideoInstance) => FormatedBlacklistedVideo 10 export type ToFormattedJSON = (this: BlacklistedVideoInstance) => FormattedBlacklistedVideo
11 11
12 export type CountTotal = () => Promise<number> 12 export type CountTotal = () => Promise<number>
13 13
@@ -21,7 +21,7 @@ export namespace BlacklistedVideoMethods {
21} 21}
22 22
23export interface BlacklistedVideoClass { 23export interface BlacklistedVideoClass {
24 toFormatedJSON: BlacklistedVideoMethods.ToFormatedJSON 24 toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON
25 countTotal: BlacklistedVideoMethods.CountTotal 25 countTotal: BlacklistedVideoMethods.CountTotal
26 list: BlacklistedVideoMethods.List 26 list: BlacklistedVideoMethods.List
27 listForApi: BlacklistedVideoMethods.ListForApi 27 listForApi: BlacklistedVideoMethods.ListForApi
@@ -39,7 +39,7 @@ export interface BlacklistedVideoInstance
39 createdAt: Date 39 createdAt: Date
40 updatedAt: Date 40 updatedAt: Date
41 41
42 toFormatedJSON: BlacklistedVideoMethods.ToFormatedJSON 42 toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON
43} 43}
44 44
45export interface BlacklistedVideoModel 45export interface BlacklistedVideoModel
diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts
index 4d1b45aa5..dc49852b6 100644
--- a/server/models/video/video-blacklist.ts
+++ b/server/models/video/video-blacklist.ts
@@ -9,7 +9,7 @@ import {
9} from './video-blacklist-interface' 9} from './video-blacklist-interface'
10 10
11let BlacklistedVideo: Sequelize.Model<BlacklistedVideoInstance, BlacklistedVideoAttributes> 11let BlacklistedVideo: Sequelize.Model<BlacklistedVideoInstance, BlacklistedVideoAttributes>
12let toFormatedJSON: BlacklistedVideoMethods.ToFormatedJSON 12let toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON
13let countTotal: BlacklistedVideoMethods.CountTotal 13let countTotal: BlacklistedVideoMethods.CountTotal
14let list: BlacklistedVideoMethods.List 14let list: BlacklistedVideoMethods.List
15let listForApi: BlacklistedVideoMethods.ListForApi 15let listForApi: BlacklistedVideoMethods.ListForApi
@@ -39,7 +39,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
39 loadByVideoId 39 loadByVideoId
40 ] 40 ]
41 const instanceMethods = [ 41 const instanceMethods = [
42 toFormatedJSON 42 toFormattedJSON
43 ] 43 ]
44 addMethodsToModel(BlacklistedVideo, classMethods, instanceMethods) 44 addMethodsToModel(BlacklistedVideo, classMethods, instanceMethods)
45 45
@@ -48,7 +48,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
48 48
49// ------------------------------ METHODS ------------------------------ 49// ------------------------------ METHODS ------------------------------
50 50
51toFormatedJSON = function (this: BlacklistedVideoInstance) { 51toFormattedJSON = function (this: BlacklistedVideoInstance) {
52 return { 52 return {
53 id: this.id, 53 id: this.id,
54 videoId: this.videoId, 54 videoId: this.videoId,
diff --git a/server/models/video/video-interface.ts b/server/models/video/video-interface.ts
index 976c70b5e..cc214fd60 100644
--- a/server/models/video/video-interface.ts
+++ b/server/models/video/video-interface.ts
@@ -6,17 +6,17 @@ import { TagAttributes, TagInstance } from './tag-interface'
6import { VideoFileAttributes, VideoFileInstance } from './video-file-interface' 6import { VideoFileAttributes, VideoFileInstance } from './video-file-interface'
7 7
8// Don't use barrel, import just what we need 8// Don't use barrel, import just what we need
9import { Video as FormatedVideo } from '../../../shared/models/videos/video.model' 9import { Video as FormattedVideo } from '../../../shared/models/videos/video.model'
10import { ResultList } from '../../../shared/models/result-list.model' 10import { ResultList } from '../../../shared/models/result-list.model'
11 11
12export type FormatedRemoteVideoFile = { 12export type FormattedRemoteVideoFile = {
13 infoHash: string 13 infoHash: string
14 resolution: number 14 resolution: number
15 extname: string 15 extname: string
16 size: number 16 size: number
17} 17}
18 18
19export type FormatedAddRemoteVideo = { 19export type FormattedAddRemoteVideo = {
20 uuid: string 20 uuid: string
21 name: string 21 name: string
22 category: number 22 category: number
@@ -33,10 +33,10 @@ export type FormatedAddRemoteVideo = {
33 views: number 33 views: number
34 likes: number 34 likes: number
35 dislikes: number 35 dislikes: number
36 files: FormatedRemoteVideoFile[] 36 files: FormattedRemoteVideoFile[]
37} 37}
38 38
39export type FormatedUpdateRemoteVideo = { 39export type FormattedUpdateRemoteVideo = {
40 uuid: string 40 uuid: string
41 name: string 41 name: string
42 category: number 42 category: number
@@ -52,14 +52,14 @@ export type FormatedUpdateRemoteVideo = {
52 views: number 52 views: number
53 likes: number 53 likes: number
54 dislikes: number 54 dislikes: number
55 files: FormatedRemoteVideoFile[] 55 files: FormattedRemoteVideoFile[]
56} 56}
57 57
58export namespace VideoMethods { 58export namespace VideoMethods {
59 export type GetThumbnailName = (this: VideoInstance) => string 59 export type GetThumbnailName = (this: VideoInstance) => string
60 export type GetPreviewName = (this: VideoInstance) => string 60 export type GetPreviewName = (this: VideoInstance) => string
61 export type IsOwned = (this: VideoInstance) => boolean 61 export type IsOwned = (this: VideoInstance) => boolean
62 export type ToFormatedJSON = (this: VideoInstance) => FormatedVideo 62 export type ToFormattedJSON = (this: VideoInstance) => FormattedVideo
63 63
64 export type GenerateMagnetUri = (this: VideoInstance, videoFile: VideoFileInstance) => string 64 export type GenerateMagnetUri = (this: VideoInstance, videoFile: VideoFileInstance) => string
65 export type GetTorrentFileName = (this: VideoInstance, videoFile: VideoFileInstance) => string 65 export type GetTorrentFileName = (this: VideoInstance, videoFile: VideoFileInstance) => string
@@ -69,8 +69,8 @@ export namespace VideoMethods {
69 export type GetVideoFilePath = (this: VideoInstance, videoFile: VideoFileInstance) => string 69 export type GetVideoFilePath = (this: VideoInstance, videoFile: VideoFileInstance) => string
70 export type CreateTorrentAndSetInfoHash = (this: VideoInstance, videoFile: VideoFileInstance) => Promise<void> 70 export type CreateTorrentAndSetInfoHash = (this: VideoInstance, videoFile: VideoFileInstance) => Promise<void>
71 71
72 export type ToAddRemoteJSON = (this: VideoInstance) => Promise<FormatedAddRemoteVideo> 72 export type ToAddRemoteJSON = (this: VideoInstance) => Promise<FormattedAddRemoteVideo>
73 export type ToUpdateRemoteJSON = (this: VideoInstance) => FormatedUpdateRemoteVideo 73 export type ToUpdateRemoteJSON = (this: VideoInstance) => FormattedUpdateRemoteVideo
74 74
75 export type TranscodeVideofile = (this: VideoInstance, inputVideoFile: VideoFileInstance) => Promise<void> 75 export type TranscodeVideofile = (this: VideoInstance, inputVideoFile: VideoFileInstance) => Promise<void>
76 76
@@ -159,7 +159,7 @@ export interface VideoInstance extends VideoClass, VideoAttributes, Sequelize.In
159 removeThumbnail: VideoMethods.RemoveThumbnail 159 removeThumbnail: VideoMethods.RemoveThumbnail
160 removeTorrent: VideoMethods.RemoveTorrent 160 removeTorrent: VideoMethods.RemoveTorrent
161 toAddRemoteJSON: VideoMethods.ToAddRemoteJSON 161 toAddRemoteJSON: VideoMethods.ToAddRemoteJSON
162 toFormatedJSON: VideoMethods.ToFormatedJSON 162 toFormattedJSON: VideoMethods.ToFormattedJSON
163 toUpdateRemoteJSON: VideoMethods.ToUpdateRemoteJSON 163 toUpdateRemoteJSON: VideoMethods.ToUpdateRemoteJSON
164 transcodeVideofile: VideoMethods.TranscodeVideofile 164 transcodeVideofile: VideoMethods.TranscodeVideofile
165 165
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 1e4bdf51c..b3ca1e668 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -52,7 +52,7 @@ let getThumbnailName: VideoMethods.GetThumbnailName
52let getPreviewName: VideoMethods.GetPreviewName 52let getPreviewName: VideoMethods.GetPreviewName
53let getTorrentFileName: VideoMethods.GetTorrentFileName 53let getTorrentFileName: VideoMethods.GetTorrentFileName
54let isOwned: VideoMethods.IsOwned 54let isOwned: VideoMethods.IsOwned
55let toFormatedJSON: VideoMethods.ToFormatedJSON 55let toFormattedJSON: VideoMethods.ToFormattedJSON
56let toAddRemoteJSON: VideoMethods.ToAddRemoteJSON 56let toAddRemoteJSON: VideoMethods.ToAddRemoteJSON
57let toUpdateRemoteJSON: VideoMethods.ToUpdateRemoteJSON 57let toUpdateRemoteJSON: VideoMethods.ToUpdateRemoteJSON
58let transcodeVideofile: VideoMethods.TranscodeVideofile 58let transcodeVideofile: VideoMethods.TranscodeVideofile
@@ -257,7 +257,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
257 removeThumbnail, 257 removeThumbnail,
258 removeTorrent, 258 removeTorrent,
259 toAddRemoteJSON, 259 toAddRemoteJSON,
260 toFormatedJSON, 260 toFormattedJSON,
261 toUpdateRemoteJSON, 261 toUpdateRemoteJSON,
262 transcodeVideofile 262 transcodeVideofile
263 ] 263 ]
@@ -414,7 +414,7 @@ generateMagnetUri = function (this: VideoInstance, videoFile: VideoFileInstance)
414 return magnetUtil.encode(magnetHash) 414 return magnetUtil.encode(magnetHash)
415} 415}
416 416
417toFormatedJSON = function (this: VideoInstance) { 417toFormattedJSON = function (this: VideoInstance) {
418 let podHost 418 let podHost
419 419
420 if (this.Author.Pod) { 420 if (this.Author.Pod) {