diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-20 16:18:16 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-21 15:39:51 +0200 |
commit | 7294aab0c879ef96c0fde15c389a2c4c1463d3c7 (patch) | |
tree | bad1176720ee04266eba5470e9956e3a7871e349 /client/src/app/shared/shared-main/video | |
parent | f95628636b6ccdf3eae2449ca718e075b072f678 (diff) | |
download | PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.tar.gz PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.tar.zst PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.zip |
Add ability to set custom field to video form
Diffstat (limited to 'client/src/app/shared/shared-main/video')
3 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-main/video/video-edit.model.ts b/client/src/app/shared/shared-main/video/video-edit.model.ts index 6a529e052..757b686c0 100644 --- a/client/src/app/shared/shared-main/video/video-edit.model.ts +++ b/client/src/app/shared/shared-main/video/video-edit.model.ts | |||
@@ -25,6 +25,8 @@ export class VideoEdit implements VideoUpdate { | |||
25 | scheduleUpdate?: VideoScheduleUpdate | 25 | scheduleUpdate?: VideoScheduleUpdate |
26 | originallyPublishedAt?: Date | string | 26 | originallyPublishedAt?: Date | string |
27 | 27 | ||
28 | pluginData?: any | ||
29 | |||
28 | constructor ( | 30 | constructor ( |
29 | video?: Video & { | 31 | video?: Video & { |
30 | tags: string[], | 32 | tags: string[], |
@@ -55,10 +57,12 @@ export class VideoEdit implements VideoUpdate { | |||
55 | 57 | ||
56 | this.scheduleUpdate = video.scheduledUpdate | 58 | this.scheduleUpdate = video.scheduledUpdate |
57 | this.originallyPublishedAt = video.originallyPublishedAt ? new Date(video.originallyPublishedAt) : null | 59 | this.originallyPublishedAt = video.originallyPublishedAt ? new Date(video.originallyPublishedAt) : null |
60 | |||
61 | this.pluginData = video.pluginData | ||
58 | } | 62 | } |
59 | } | 63 | } |
60 | 64 | ||
61 | patch (values: { [ id: string ]: string }) { | 65 | patch (values: { [ id: string ]: any }) { |
62 | Object.keys(values).forEach((key) => { | 66 | Object.keys(values).forEach((key) => { |
63 | this[ key ] = values[ key ] | 67 | this[ key ] = values[ key ] |
64 | }) | 68 | }) |
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index 73f0198e2..0dca3da0d 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts | |||
@@ -84,6 +84,8 @@ export class Video implements VideoServerModel { | |||
84 | currentTime: number | 84 | currentTime: number |
85 | } | 85 | } |
86 | 86 | ||
87 | pluginData?: any | ||
88 | |||
87 | static buildClientUrl (videoUUID: string) { | 89 | static buildClientUrl (videoUUID: string) { |
88 | return '/videos/watch/' + videoUUID | 90 | return '/videos/watch/' + videoUUID |
89 | } | 91 | } |
@@ -152,6 +154,8 @@ export class Video implements VideoServerModel { | |||
152 | 154 | ||
153 | this.originInstanceHost = this.account.host | 155 | this.originInstanceHost = this.account.host |
154 | this.originInstanceUrl = 'https://' + this.originInstanceHost | 156 | this.originInstanceUrl = 'https://' + this.originInstanceHost |
157 | |||
158 | this.pluginData = hash.pluginData | ||
155 | } | 159 | } |
156 | 160 | ||
157 | isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { | 161 | isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { |
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 48aff82b4..8a688c8ed 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -96,6 +96,7 @@ export class VideoService implements VideosProvider { | |||
96 | downloadEnabled: video.downloadEnabled, | 96 | downloadEnabled: video.downloadEnabled, |
97 | thumbnailfile: video.thumbnailfile, | 97 | thumbnailfile: video.thumbnailfile, |
98 | previewfile: video.previewfile, | 98 | previewfile: video.previewfile, |
99 | pluginData: video.pluginData, | ||
99 | scheduleUpdate, | 100 | scheduleUpdate, |
100 | originallyPublishedAt | 101 | originallyPublishedAt |
101 | } | 102 | } |