diff options
Diffstat (limited to 'server/models/video/video-interface.ts')
-rw-r--r-- | server/models/video/video-interface.ts | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/server/models/video/video-interface.ts b/server/models/video/video-interface.ts index b836d6da6..2fabcd906 100644 --- a/server/models/video/video-interface.ts +++ b/server/models/video/video-interface.ts | |||
@@ -9,6 +9,7 @@ import { Video as FormatedVideo } from '../../../shared/models/videos/video.mode | |||
9 | import { ResultList } from '../../../shared/models/result-list.model' | 9 | import { ResultList } from '../../../shared/models/result-list.model' |
10 | 10 | ||
11 | export type FormatedAddRemoteVideo = { | 11 | export type FormatedAddRemoteVideo = { |
12 | uuid: string | ||
12 | name: string | 13 | name: string |
13 | category: number | 14 | category: number |
14 | licence: number | 15 | licence: number |
@@ -16,7 +17,6 @@ export type FormatedAddRemoteVideo = { | |||
16 | nsfw: boolean | 17 | nsfw: boolean |
17 | description: string | 18 | description: string |
18 | infoHash: string | 19 | infoHash: string |
19 | remoteId: string | ||
20 | author: string | 20 | author: string |
21 | duration: number | 21 | duration: number |
22 | thumbnailData: string | 22 | thumbnailData: string |
@@ -30,6 +30,7 @@ export type FormatedAddRemoteVideo = { | |||
30 | } | 30 | } |
31 | 31 | ||
32 | export type FormatedUpdateRemoteVideo = { | 32 | export type FormatedUpdateRemoteVideo = { |
33 | uuid: string | ||
33 | name: string | 34 | name: string |
34 | category: number | 35 | category: number |
35 | licence: number | 36 | licence: number |
@@ -37,7 +38,6 @@ export type FormatedUpdateRemoteVideo = { | |||
37 | nsfw: boolean | 38 | nsfw: boolean |
38 | description: string | 39 | description: string |
39 | infoHash: string | 40 | infoHash: string |
40 | remoteId: string | ||
41 | author: string | 41 | author: string |
42 | duration: number | 42 | duration: number |
43 | tags: string[] | 43 | tags: string[] |
@@ -80,10 +80,12 @@ export namespace VideoMethods { | |||
80 | sort: string | 80 | sort: string |
81 | ) => Promise< ResultList<VideoInstance> > | 81 | ) => Promise< ResultList<VideoInstance> > |
82 | 82 | ||
83 | export type Load = (id: string) => Promise<VideoInstance> | 83 | export type Load = (id: number) => Promise<VideoInstance> |
84 | export type LoadByHostAndRemoteId = (fromHost: string, remoteId: string) => Promise<VideoInstance> | 84 | export type LoadByUUID = (uuid: string) => Promise<VideoInstance> |
85 | export type LoadAndPopulateAuthor = (id: string) => Promise<VideoInstance> | 85 | export type LoadByHostAndUUID = (fromHost: string, uuid: string) => Promise<VideoInstance> |
86 | export type LoadAndPopulateAuthorAndPodAndTags = (id: string) => Promise<VideoInstance> | 86 | export type LoadAndPopulateAuthor = (id: number) => Promise<VideoInstance> |
87 | export type LoadAndPopulateAuthorAndPodAndTags = (id: number) => Promise<VideoInstance> | ||
88 | export type LoadByUUIDAndPopulateAuthorAndPodAndTags = (uuid: string) => Promise<VideoInstance> | ||
87 | } | 89 | } |
88 | 90 | ||
89 | export interface VideoClass { | 91 | export interface VideoClass { |
@@ -102,19 +104,21 @@ export interface VideoClass { | |||
102 | getDurationFromFile: VideoMethods.GetDurationFromFile | 104 | getDurationFromFile: VideoMethods.GetDurationFromFile |
103 | list: VideoMethods.List | 105 | list: VideoMethods.List |
104 | listForApi: VideoMethods.ListForApi | 106 | listForApi: VideoMethods.ListForApi |
105 | loadByHostAndRemoteId: VideoMethods.LoadByHostAndRemoteId | 107 | loadByHostAndUUID: VideoMethods.LoadByHostAndUUID |
106 | listOwnedAndPopulateAuthorAndTags: VideoMethods.ListOwnedAndPopulateAuthorAndTags | 108 | listOwnedAndPopulateAuthorAndTags: VideoMethods.ListOwnedAndPopulateAuthorAndTags |
107 | listOwnedByAuthor: VideoMethods.ListOwnedByAuthor | 109 | listOwnedByAuthor: VideoMethods.ListOwnedByAuthor |
108 | load: VideoMethods.Load | 110 | load: VideoMethods.Load |
111 | loadByUUID: VideoMethods.LoadByUUID | ||
109 | loadAndPopulateAuthor: VideoMethods.LoadAndPopulateAuthor | 112 | loadAndPopulateAuthor: VideoMethods.LoadAndPopulateAuthor |
110 | loadAndPopulateAuthorAndPodAndTags: VideoMethods.LoadAndPopulateAuthorAndPodAndTags | 113 | loadAndPopulateAuthorAndPodAndTags: VideoMethods.LoadAndPopulateAuthorAndPodAndTags |
114 | loadByUUIDAndPopulateAuthorAndPodAndTags: VideoMethods.LoadByUUIDAndPopulateAuthorAndPodAndTags | ||
111 | searchAndPopulateAuthorAndPodAndTags: VideoMethods.SearchAndPopulateAuthorAndPodAndTags | 115 | searchAndPopulateAuthorAndPodAndTags: VideoMethods.SearchAndPopulateAuthorAndPodAndTags |
112 | } | 116 | } |
113 | 117 | ||
114 | export interface VideoAttributes { | 118 | export interface VideoAttributes { |
119 | uuid?: string | ||
115 | name: string | 120 | name: string |
116 | extname: string | 121 | extname: string |
117 | remoteId: string | ||
118 | category: number | 122 | category: number |
119 | licence: number | 123 | licence: number |
120 | language: number | 124 | language: number |
@@ -125,13 +129,14 @@ export interface VideoAttributes { | |||
125 | views?: number | 129 | views?: number |
126 | likes?: number | 130 | likes?: number |
127 | dislikes?: number | 131 | dislikes?: number |
132 | remote: boolean | ||
128 | 133 | ||
129 | Author?: AuthorInstance | 134 | Author?: AuthorInstance |
130 | Tags?: TagInstance[] | 135 | Tags?: TagInstance[] |
131 | } | 136 | } |
132 | 137 | ||
133 | export interface VideoInstance extends VideoClass, VideoAttributes, Sequelize.Instance<VideoAttributes> { | 138 | export interface VideoInstance extends VideoClass, VideoAttributes, Sequelize.Instance<VideoAttributes> { |
134 | id: string | 139 | id: number |
135 | createdAt: Date | 140 | createdAt: Date |
136 | updatedAt: Date | 141 | updatedAt: Date |
137 | 142 | ||