diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-01 18:56:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-01 18:56:26 +0100 |
commit | 202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7 (patch) | |
tree | 605df063371b6be32ca0773bf2917b0c5d9163ae /client/src/app/shared/video/video-edit.model.ts | |
parent | c30745f342480b59fb0856a059c8c2fbffbcfc6a (diff) | |
download | PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.tar.gz PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.tar.zst PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.zip |
Begin videos of an account
Diffstat (limited to 'client/src/app/shared/video/video-edit.model.ts')
-rw-r--r-- | client/src/app/shared/video/video-edit.model.ts | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts new file mode 100644 index 000000000..88d23a59f --- /dev/null +++ b/client/src/app/shared/video/video-edit.model.ts | |||
@@ -0,0 +1,50 @@ | |||
1 | import { VideoDetails } from './video-details.model' | ||
2 | import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' | ||
3 | |||
4 | export class VideoEdit { | ||
5 | category: number | ||
6 | licence: number | ||
7 | language: number | ||
8 | description: string | ||
9 | name: string | ||
10 | tags: string[] | ||
11 | nsfw: boolean | ||
12 | channel: number | ||
13 | privacy: VideoPrivacy | ||
14 | uuid?: string | ||
15 | id?: number | ||
16 | |||
17 | constructor (videoDetails: VideoDetails) { | ||
18 | this.id = videoDetails.id | ||
19 | this.uuid = videoDetails.uuid | ||
20 | this.category = videoDetails.category | ||
21 | this.licence = videoDetails.licence | ||
22 | this.language = videoDetails.language | ||
23 | this.description = videoDetails.description | ||
24 | this.name = videoDetails.name | ||
25 | this.tags = videoDetails.tags | ||
26 | this.nsfw = videoDetails.nsfw | ||
27 | this.channel = videoDetails.channel.id | ||
28 | this.privacy = videoDetails.privacy | ||
29 | } | ||
30 | |||
31 | patch (values: Object) { | ||
32 | Object.keys(values).forEach((key) => { | ||
33 | this[key] = values[key] | ||
34 | }) | ||
35 | } | ||
36 | |||
37 | toJSON () { | ||
38 | return { | ||
39 | category: this.category, | ||
40 | licence: this.licence, | ||
41 | language: this.language, | ||
42 | description: this.description, | ||
43 | name: this.name, | ||
44 | tags: this.tags, | ||
45 | nsfw: this.nsfw, | ||
46 | channel: this.channel, | ||
47 | privacy: this.privacy | ||
48 | } | ||
49 | } | ||
50 | } | ||