]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/video/video-edit.model.ts
Redirect to uuid video route after upload
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-edit.model.ts
CommitLineData
9d9597df 1import { VideoDetails } from './video-details.model'
fd45e8f4 2import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum'
9d9597df 3
404b54e1
C
4export 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
fd45e8f4 13 privacy: VideoPrivacy
404b54e1
C
14 uuid?: string
15 id?: number
16
cadb46d8
C
17 constructor (videoDetails?: VideoDetails) {
18 if (videoDetails) {
19 this.id = videoDetails.id
20 this.uuid = videoDetails.uuid
21 this.category = videoDetails.category
22 this.licence = videoDetails.licence
23 this.language = videoDetails.language
24 this.description = videoDetails.description
25 this.name = videoDetails.name
26 this.tags = videoDetails.tags
27 this.nsfw = videoDetails.nsfw
28 this.channel = videoDetails.channel.id
29 this.privacy = videoDetails.privacy
30 }
9d9597df
C
31 }
32
404b54e1
C
33 patch (values: Object) {
34 Object.keys(values).forEach((key) => {
35 this[key] = values[key]
36 })
37 }
38
39 toJSON () {
40 return {
41 category: this.category,
42 licence: this.licence,
43 language: this.language,
44 description: this.description,
45 name: this.name,
46 tags: this.tags,
47 nsfw: this.nsfw,
fd45e8f4
C
48 channel: this.channel,
49 privacy: this.privacy
404b54e1
C
50 }
51 }
52}