diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-03 09:27:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-06 11:19:16 +0200 |
commit | d7f83948a1af0ef3bed61f83e87e826902c96f7d (patch) | |
tree | d22177bcbf22aeb054960372a6bc39bea6077692 /server/models/video/video-import.ts | |
parent | ed31c059851a30bd5ba9999f8ecb3822d576b9f4 (diff) | |
download | PeerTube-d7f83948a1af0ef3bed61f83e87e826902c96f7d.tar.gz PeerTube-d7f83948a1af0ef3bed61f83e87e826902c96f7d.tar.zst PeerTube-d7f83948a1af0ef3bed61f83e87e826902c96f7d.zip |
Correctly handle video import errors
Diffstat (limited to 'server/models/video/video-import.ts')
-rw-r--r-- | server/models/video/video-import.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.ts index 6b8a16b65..c2e55509c 100644 --- a/server/models/video/video-import.ts +++ b/server/models/video/video-import.ts | |||
@@ -26,7 +26,7 @@ import { TagModel } from './tag' | |||
26 | include: [ | 26 | include: [ |
27 | { | 27 | { |
28 | model: () => VideoModel, | 28 | model: () => VideoModel, |
29 | required: true, | 29 | required: false, |
30 | include: [ | 30 | include: [ |
31 | { | 31 | { |
32 | model: () => VideoChannelModel, | 32 | model: () => VideoChannelModel, |
@@ -112,7 +112,7 @@ export class VideoImportModel extends Model<VideoImportModel> { | |||
112 | include: [ | 112 | include: [ |
113 | { | 113 | { |
114 | model: VideoModel, | 114 | model: VideoModel, |
115 | required: true, | 115 | required: false, |
116 | include: [ | 116 | include: [ |
117 | { | 117 | { |
118 | model: VideoChannelModel, | 118 | model: VideoChannelModel, |
@@ -157,11 +157,13 @@ export class VideoImportModel extends Model<VideoImportModel> { | |||
157 | : undefined | 157 | : undefined |
158 | 158 | ||
159 | return { | 159 | return { |
160 | id: this.id, | ||
160 | targetUrl: this.targetUrl, | 161 | targetUrl: this.targetUrl, |
161 | state: { | 162 | state: { |
162 | id: this.state, | 163 | id: this.state, |
163 | label: VideoImportModel.getStateLabel(this.state) | 164 | label: VideoImportModel.getStateLabel(this.state) |
164 | }, | 165 | }, |
166 | error: this.error, | ||
165 | updatedAt: this.updatedAt.toISOString(), | 167 | updatedAt: this.updatedAt.toISOString(), |
166 | createdAt: this.createdAt.toISOString(), | 168 | createdAt: this.createdAt.toISOString(), |
167 | video | 169 | video |