]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-abuse-interface.ts
Add previews cache system between pods
[github/Chocobozzz/PeerTube.git] / server / models / video / video-abuse-interface.ts
index f3e32f79c55f41e5d07d7447ac58e989eeebc197..fa45aa5f907d32534734da590e8b2fc23d9c74a6 100644 (file)
@@ -1,15 +1,16 @@
 import * as Sequelize from 'sequelize'
+import * as Promise from 'bluebird'
 
 import { PodInstance } from '../pod'
+import { ResultList } from '../../../shared'
 
 // Don't use barrel, import just what we need
-import { VideoAbuse as FormatedVideoAbuse } from '../../../shared/models/video-abuse.model'
+import { VideoAbuse as FormatedVideoAbuse } from '../../../shared/models/videos/video-abuse.model'
 
 export namespace VideoAbuseMethods {
-  export type toFormatedJSON = () => FormatedVideoAbuse
+  export type ToFormatedJSON = (this: VideoAbuseInstance) => FormatedVideoAbuse
 
-  export type ListForApiCallback = (err: Error, videoAbuseInstances?: VideoAbuseInstance[], total?: number) => void
-  export type ListForApi = (start: number, count: number, sort: string, callback: ListForApiCallback) => void
+  export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoAbuseInstance> >
 }
 
 export interface VideoAbuseClass {
@@ -19,7 +20,7 @@ export interface VideoAbuseClass {
 export interface VideoAbuseAttributes {
   reporterUsername: string
   reason: string
-  videoId: string
+  videoId: number
 }
 
 export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttributes, Sequelize.Instance<VideoAbuseAttributes> {
@@ -28,6 +29,8 @@ export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttribute
   updatedAt: Date
 
   Pod: PodInstance
+
+  toFormatedJSON: VideoAbuseMethods.ToFormatedJSON
 }
 
 export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> {}