aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request/request-video-qadu-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-16 09:45:46 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-16 09:45:46 +0200
commit74889a71fe687dda74f2a687653122327807af36 (patch)
treee938e8b6401b74fbec80513a877d9967f2c0dbcd /server/models/request/request-video-qadu-interface.ts
parent15a302943d84bc0978b84fe33110c4daa451d311 (diff)
downloadPeerTube-74889a71fe687dda74f2a687653122327807af36.tar.gz
PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.zst
PeerTube-74889a71fe687dda74f2a687653122327807af36.zip
Reorganize model files
Diffstat (limited to 'server/models/request/request-video-qadu-interface.ts')
-rw-r--r--server/models/request/request-video-qadu-interface.ts46
1 files changed, 46 insertions, 0 deletions
diff --git a/server/models/request/request-video-qadu-interface.ts b/server/models/request/request-video-qadu-interface.ts
new file mode 100644
index 000000000..625b063dc
--- /dev/null
+++ b/server/models/request/request-video-qadu-interface.ts
@@ -0,0 +1,46 @@
1import * as Sequelize from 'sequelize'
2
3import { VideoInstance } from '../video'
4import { PodInstance } from '../pod'
5
6export type RequestsVideoQaduGrouped = {
7 [ podId: number ]: {
8 request: RequestVideoQaduInstance
9 video: VideoInstance
10 pod: PodInstance
11 }
12}
13
14export namespace RequestVideoQaduMethods {
15 export type CountTotalRequestsCallback = (err: Error, total: number) => void
16 export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
17
18 export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void
19 export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void
20
21 export type RemoveByRequestIdsAndPodCallback = () => void
22 export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void
23
24 export type RemoveAllCallback = () => void
25 export type RemoveAll = (callback: RemoveAllCallback) => void
26}
27
28export interface RequestVideoQaduClass {
29 countTotalRequests: RequestVideoQaduMethods.CountTotalRequests
30 listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom
31 removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod
32 removeAll: RequestVideoQaduMethods.RemoveAll
33}
34
35export interface RequestVideoQaduAttributes {
36 type: string
37}
38
39export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> {
40 id: number
41
42 Pod: PodInstance
43 Video: VideoInstance
44}
45
46export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {}