diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-05 13:26:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-05 14:14:16 +0200 |
commit | 6fcd19ba737f1f5614a56c6925adb882dea43b8d (patch) | |
tree | 3365a96d82bc7f00ae504a568725c8e914150cf8 /server/models/request/request-video-qadu-interface.ts | |
parent | 5fe7e898316e18369c3e1aba307b55077adc7bfb (diff) | |
download | PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.gz PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.zst PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.zip |
Move to promises
Closes https://github.com/Chocobozzz/PeerTube/issues/74
Diffstat (limited to 'server/models/request/request-video-qadu-interface.ts')
-rw-r--r-- | server/models/request/request-video-qadu-interface.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/models/request/request-video-qadu-interface.ts b/server/models/request/request-video-qadu-interface.ts index 805771cda..9a172a4d4 100644 --- a/server/models/request/request-video-qadu-interface.ts +++ b/server/models/request/request-video-qadu-interface.ts | |||
@@ -1,5 +1,7 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Promise from 'bluebird' | ||
2 | 3 | ||
4 | import { AbstractRequestClass, AbstractRequestToPodClass } from './abstract-request-interface' | ||
3 | import { VideoInstance } from '../video' | 5 | import { VideoInstance } from '../video' |
4 | import { PodInstance } from '../pod' | 6 | import { PodInstance } from '../pod' |
5 | 7 | ||
@@ -14,20 +16,16 @@ export type RequestsVideoQaduGrouped = { | |||
14 | } | 16 | } |
15 | 17 | ||
16 | export namespace RequestVideoQaduMethods { | 18 | export namespace RequestVideoQaduMethods { |
17 | export type CountTotalRequestsCallback = (err: Error, total: number) => void | 19 | export type CountTotalRequests = () => Promise<number> |
18 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void | ||
19 | 20 | ||
20 | export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void | 21 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number) => Promise<RequestsVideoQaduGrouped> |
21 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void | ||
22 | 22 | ||
23 | export type RemoveByRequestIdsAndPodCallback = () => void | 23 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number) => Promise<number> |
24 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void | ||
25 | 24 | ||
26 | export type RemoveAllCallback = () => void | 25 | export type RemoveAll = () => Promise<void> |
27 | export type RemoveAll = (callback: RemoveAllCallback) => void | ||
28 | } | 26 | } |
29 | 27 | ||
30 | export interface RequestVideoQaduClass { | 28 | export interface RequestVideoQaduClass extends AbstractRequestClass<RequestsVideoQaduGrouped>, AbstractRequestToPodClass { |
31 | countTotalRequests: RequestVideoQaduMethods.CountTotalRequests | 29 | countTotalRequests: RequestVideoQaduMethods.CountTotalRequests |
32 | listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom | 30 | listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom |
33 | removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod | 31 | removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod |
@@ -38,11 +36,13 @@ export interface RequestVideoQaduAttributes { | |||
38 | type: RequestVideoQaduType | 36 | type: RequestVideoQaduType |
39 | } | 37 | } |
40 | 38 | ||
41 | export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { | 39 | export interface RequestVideoQaduInstance |
40 | extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { | ||
42 | id: number | 41 | id: number |
43 | 42 | ||
44 | Pod: PodInstance | 43 | Pod: PodInstance |
45 | Video: VideoInstance | 44 | Video: VideoInstance |
46 | } | 45 | } |
47 | 46 | ||
48 | export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} | 47 | export interface RequestVideoQaduModel |
48 | extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} | ||