aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request/request-video-event-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request/request-video-event-interface.ts')
-rw-r--r--server/models/request/request-video-event-interface.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/server/models/request/request-video-event-interface.ts b/server/models/request/request-video-event-interface.ts
index 3ed03339a..a5032e1b1 100644
--- a/server/models/request/request-video-event-interface.ts
+++ b/server/models/request/request-video-event-interface.ts
@@ -1,5 +1,7 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import * as Promise from 'bluebird'
2 3
4import { AbstractRequestClass, AbstractRequestToPodClass } from './abstract-request-interface'
3import { VideoInstance } from '../video' 5import { VideoInstance } from '../video'
4import { PodInstance } from '../pod' 6import { PodInstance } from '../pod'
5 7
@@ -16,20 +18,16 @@ export type RequestsVideoEventGrouped = {
16} 18}
17 19
18export namespace RequestVideoEventMethods { 20export namespace RequestVideoEventMethods {
19 export type CountTotalRequestsCallback = (err: Error, total: number) => void 21 export type CountTotalRequests = () => Promise<number>
20 export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
21 22
22 export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoEventGrouped) => void 23 export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number) => Promise<RequestsVideoEventGrouped>
23 export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void
24 24
25 export type RemoveByRequestIdsAndPodCallback = () => void 25 export type RemoveByRequestIdsAndPod = (ids: number[], podId: number) => Promise<number>
26 export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void
27 26
28 export type RemoveAllCallback = () => void 27 export type RemoveAll = () => Promise<void>
29 export type RemoveAll = (callback: RemoveAllCallback) => void
30} 28}
31 29
32export interface RequestVideoEventClass { 30export interface RequestVideoEventClass extends AbstractRequestClass<RequestsVideoEventGrouped>, AbstractRequestToPodClass {
33 countTotalRequests: RequestVideoEventMethods.CountTotalRequests 31 countTotalRequests: RequestVideoEventMethods.CountTotalRequests
34 listWithLimitAndRandom: RequestVideoEventMethods.ListWithLimitAndRandom 32 listWithLimitAndRandom: RequestVideoEventMethods.ListWithLimitAndRandom
35 removeByRequestIdsAndPod: RequestVideoEventMethods.RemoveByRequestIdsAndPod 33 removeByRequestIdsAndPod: RequestVideoEventMethods.RemoveByRequestIdsAndPod
@@ -41,10 +39,12 @@ export interface RequestVideoEventAttributes {
41 count: number 39 count: number
42} 40}
43 41
44export interface RequestVideoEventInstance extends RequestVideoEventClass, RequestVideoEventAttributes, Sequelize.Instance<RequestVideoEventAttributes> { 42export interface RequestVideoEventInstance
43 extends RequestVideoEventClass, RequestVideoEventAttributes, Sequelize.Instance<RequestVideoEventAttributes> {
45 id: number 44 id: number
46 45
47 Video: VideoInstance 46 Video: VideoInstance
48} 47}
49 48
50export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {} 49export interface RequestVideoEventModel
50 extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {}