aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-24 19:41:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 09:11:38 +0200
commit72c7248b6fdcdb2175e726ff51b42e7555f2bd84 (patch)
tree1bfdee99dbe2392cc997edba8e314e2a8a401c72 /server/models/video/video-interface.ts
parent8113a93a0d9f31aa9e23702bbc31b8a76275ae22 (diff)
downloadPeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.gz
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.zst
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.zip
Add video channels
Diffstat (limited to 'server/models/video/video-interface.ts')
-rw-r--r--server/models/video/video-interface.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/server/models/video/video-interface.ts b/server/models/video/video-interface.ts
index 86ce84dd9..4b5ae08c2 100644
--- a/server/models/video/video-interface.ts
+++ b/server/models/video/video-interface.ts
@@ -6,16 +6,21 @@ import { TagAttributes, TagInstance } from './tag-interface'
6import { VideoFileAttributes, VideoFileInstance } from './video-file-interface' 6import { VideoFileAttributes, VideoFileInstance } from './video-file-interface'
7 7
8// Don't use barrel, import just what we need 8// Don't use barrel, import just what we need
9import { Video as FormattedVideo } from '../../../shared/models/videos/video.model' 9import {
10 Video as FormattedVideo,
11 VideoDetails as FormattedDetailsVideo
12} from '../../../shared/models/videos/video.model'
10import { RemoteVideoUpdateData } from '../../../shared/models/pods/remote-video/remote-video-update-request.model' 13import { RemoteVideoUpdateData } from '../../../shared/models/pods/remote-video/remote-video-update-request.model'
11import { RemoteVideoCreateData } from '../../../shared/models/pods/remote-video/remote-video-create-request.model' 14import { RemoteVideoCreateData } from '../../../shared/models/pods/remote-video/remote-video-create-request.model'
12import { ResultList } from '../../../shared/models/result-list.model' 15import { ResultList } from '../../../shared/models/result-list.model'
16import { VideoChannelInstance } from './video-channel-interface'
13 17
14export namespace VideoMethods { 18export namespace VideoMethods {
15 export type GetThumbnailName = (this: VideoInstance) => string 19 export type GetThumbnailName = (this: VideoInstance) => string
16 export type GetPreviewName = (this: VideoInstance) => string 20 export type GetPreviewName = (this: VideoInstance) => string
17 export type IsOwned = (this: VideoInstance) => boolean 21 export type IsOwned = (this: VideoInstance) => boolean
18 export type ToFormattedJSON = (this: VideoInstance) => FormattedVideo 22 export type ToFormattedJSON = (this: VideoInstance) => FormattedVideo
23 export type ToFormattedDetailsJSON = (this: VideoInstance) => FormattedDetailsVideo
19 24
20 export type GetOriginalFile = (this: VideoInstance) => VideoFileInstance 25 export type GetOriginalFile = (this: VideoInstance) => VideoFileInstance
21 export type GetTorrentFileName = (this: VideoInstance, videoFile: VideoFileInstance) => string 26 export type GetTorrentFileName = (this: VideoInstance, videoFile: VideoFileInstance) => string
@@ -52,8 +57,8 @@ export namespace VideoMethods {
52 ) => Promise< ResultList<VideoInstance> > 57 ) => Promise< ResultList<VideoInstance> >
53 58
54 export type Load = (id: number) => Promise<VideoInstance> 59 export type Load = (id: number) => Promise<VideoInstance>
55 export type LoadByUUID = (uuid: string) => Promise<VideoInstance> 60 export type LoadByUUID = (uuid: string, t?: Sequelize.Transaction) => Promise<VideoInstance>
56 export type LoadByHostAndUUID = (fromHost: string, uuid: string) => Promise<VideoInstance> 61 export type LoadByHostAndUUID = (fromHost: string, uuid: string, t?: Sequelize.Transaction) => Promise<VideoInstance>
57 export type LoadAndPopulateAuthor = (id: number) => Promise<VideoInstance> 62 export type LoadAndPopulateAuthor = (id: number) => Promise<VideoInstance>
58 export type LoadAndPopulateAuthorAndPodAndTags = (id: number) => Promise<VideoInstance> 63 export type LoadAndPopulateAuthorAndPodAndTags = (id: number) => Promise<VideoInstance>
59 export type LoadByUUIDAndPopulateAuthorAndPodAndTags = (uuid: string) => Promise<VideoInstance> 64 export type LoadByUUIDAndPopulateAuthorAndPodAndTags = (uuid: string) => Promise<VideoInstance>
@@ -94,7 +99,9 @@ export interface VideoAttributes {
94 dislikes?: number 99 dislikes?: number
95 remote: boolean 100 remote: boolean
96 101
97 Author?: AuthorInstance 102 channelId?: number
103
104 VideoChannel?: VideoChannelInstance
98 Tags?: TagInstance[] 105 Tags?: TagInstance[]
99 VideoFiles?: VideoFileInstance[] 106 VideoFiles?: VideoFileInstance[]
100} 107}
@@ -121,6 +128,7 @@ export interface VideoInstance extends VideoClass, VideoAttributes, Sequelize.In
121 removeTorrent: VideoMethods.RemoveTorrent 128 removeTorrent: VideoMethods.RemoveTorrent
122 toAddRemoteJSON: VideoMethods.ToAddRemoteJSON 129 toAddRemoteJSON: VideoMethods.ToAddRemoteJSON
123 toFormattedJSON: VideoMethods.ToFormattedJSON 130 toFormattedJSON: VideoMethods.ToFormattedJSON
131 toFormattedDetailsJSON: VideoMethods.ToFormattedDetailsJSON
124 toUpdateRemoteJSON: VideoMethods.ToUpdateRemoteJSON 132 toUpdateRemoteJSON: VideoMethods.ToUpdateRemoteJSON
125 optimizeOriginalVideofile: VideoMethods.OptimizeOriginalVideofile 133 optimizeOriginalVideofile: VideoMethods.OptimizeOriginalVideofile
126 transcodeOriginalVideofile: VideoMethods.TranscodeOriginalVideofile 134 transcodeOriginalVideofile: VideoMethods.TranscodeOriginalVideofile