diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-24 19:41:09 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-26 09:11:38 +0200 |
commit | 72c7248b6fdcdb2175e726ff51b42e7555f2bd84 (patch) | |
tree | 1bfdee99dbe2392cc997edba8e314e2a8a401c72 /server/models/video/author-interface.ts | |
parent | 8113a93a0d9f31aa9e23702bbc31b8a76275ae22 (diff) | |
download | PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.gz PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.zst PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.zip |
Add video channels
Diffstat (limited to 'server/models/video/author-interface.ts')
-rw-r--r-- | server/models/video/author-interface.ts | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/server/models/video/author-interface.ts b/server/models/video/author-interface.ts index 52a00a1d3..fc69ff3c2 100644 --- a/server/models/video/author-interface.ts +++ b/server/models/video/author-interface.ts | |||
@@ -2,31 +2,44 @@ import * as Sequelize from 'sequelize' | |||
2 | import * as Promise from 'bluebird' | 2 | import * as Promise from 'bluebird' |
3 | 3 | ||
4 | import { PodInstance } from '../pod/pod-interface' | 4 | import { PodInstance } from '../pod/pod-interface' |
5 | import { RemoteVideoAuthorCreateData } from '../../../shared/models/pods/remote-video/remote-video-author-create-request.model' | ||
6 | import { VideoChannelInstance } from './video-channel-interface' | ||
5 | 7 | ||
6 | export namespace AuthorMethods { | 8 | export namespace AuthorMethods { |
7 | export type FindOrCreateAuthor = ( | 9 | export type Load = (id: number) => Promise<AuthorInstance> |
8 | name: string, | 10 | export type LoadByUUID = (uuid: string) => Promise<AuthorInstance> |
9 | podId: number, | 11 | export type LoadAuthorByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Promise<AuthorInstance> |
10 | userId: number, | 12 | export type ListOwned = () => Promise<AuthorInstance[]> |
11 | transaction: Sequelize.Transaction | 13 | |
12 | ) => Promise<AuthorInstance> | 14 | export type ToAddRemoteJSON = (this: AuthorInstance) => RemoteVideoAuthorCreateData |
15 | export type IsOwned = (this: AuthorInstance) => boolean | ||
13 | } | 16 | } |
14 | 17 | ||
15 | export interface AuthorClass { | 18 | export interface AuthorClass { |
16 | findOrCreateAuthor: AuthorMethods.FindOrCreateAuthor | 19 | loadAuthorByPodAndUUID: AuthorMethods.LoadAuthorByPodAndUUID |
20 | load: AuthorMethods.Load | ||
21 | loadByUUID: AuthorMethods.LoadByUUID | ||
22 | listOwned: AuthorMethods.ListOwned | ||
17 | } | 23 | } |
18 | 24 | ||
19 | export interface AuthorAttributes { | 25 | export interface AuthorAttributes { |
20 | name: string | 26 | name: string |
27 | uuid?: string | ||
28 | |||
29 | podId?: number | ||
30 | userId?: number | ||
21 | } | 31 | } |
22 | 32 | ||
23 | export interface AuthorInstance extends AuthorClass, AuthorAttributes, Sequelize.Instance<AuthorAttributes> { | 33 | export interface AuthorInstance extends AuthorClass, AuthorAttributes, Sequelize.Instance<AuthorAttributes> { |
34 | isOwned: AuthorMethods.IsOwned | ||
35 | toAddRemoteJSON: AuthorMethods.ToAddRemoteJSON | ||
36 | |||
24 | id: number | 37 | id: number |
25 | createdAt: Date | 38 | createdAt: Date |
26 | updatedAt: Date | 39 | updatedAt: Date |
27 | 40 | ||
28 | podId: number | ||
29 | Pod: PodInstance | 41 | Pod: PodInstance |
42 | VideoChannels: VideoChannelInstance[] | ||
30 | } | 43 | } |
31 | 44 | ||
32 | export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {} | 45 | export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {} |