]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/models/video/video-blacklist-interface.ts
Implement video transcoding on server side
[github/Chocobozzz/PeerTube.git] / server / models / video / video-blacklist-interface.ts
CommitLineData
e02643f3 1import * as Sequelize from 'sequelize'
6fcd19ba
C
2import * as Promise from 'bluebird'
3
792dbaf0 4import { SortType } from '../../helpers'
6fcd19ba 5import { ResultList } from '../../../shared'
792dbaf0 6import { VideoInstance } from './video-interface'
e02643f3 7
69818c93 8// Don't use barrel, import just what we need
0aef76c4 9import { BlacklistedVideo as FormattedBlacklistedVideo } from '../../../shared/models/videos/video-blacklist.model'
69818c93 10
e02643f3 11export namespace BlacklistedVideoMethods {
0aef76c4 12 export type ToFormattedJSON = (this: BlacklistedVideoInstance) => FormattedBlacklistedVideo
69818c93 13
6fcd19ba 14 export type CountTotal = () => Promise<number>
69818c93 15
6fcd19ba 16 export type List = () => Promise<BlacklistedVideoInstance[]>
69818c93 17
792dbaf0 18 export type ListForApi = (start: number, count: number, sort: SortType) => Promise< ResultList<BlacklistedVideoInstance> >
69818c93 19
6fcd19ba 20 export type LoadById = (id: number) => Promise<BlacklistedVideoInstance>
e02643f3 21
0a6658fd 22 export type LoadByVideoId = (id: number) => Promise<BlacklistedVideoInstance>
e02643f3
C
23}
24
25export interface BlacklistedVideoClass {
0aef76c4 26 toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON
e02643f3
C
27 countTotal: BlacklistedVideoMethods.CountTotal
28 list: BlacklistedVideoMethods.List
29 listForApi: BlacklistedVideoMethods.ListForApi
30 loadById: BlacklistedVideoMethods.LoadById
31 loadByVideoId: BlacklistedVideoMethods.LoadByVideoId
32}
33
34export interface BlacklistedVideoAttributes {
0a6658fd 35 videoId: number
792dbaf0
GS
36
37 Video?: VideoInstance
e02643f3
C
38}
39
6fcd19ba
C
40export interface BlacklistedVideoInstance
41 extends BlacklistedVideoClass, BlacklistedVideoAttributes, Sequelize.Instance<BlacklistedVideoAttributes> {
e02643f3
C
42 id: number
43 createdAt: Date
44 updatedAt: Date
154898b0 45
0aef76c4 46 toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON
e02643f3
C
47}
48
6fcd19ba
C
49export interface BlacklistedVideoModel
50 extends BlacklistedVideoClass, Sequelize.Model<BlacklistedVideoInstance, BlacklistedVideoAttributes> {}