Allow to edit video attribute "importedFrom" with the UI
This commit is contained in:
parent
d1d14cd540
commit
43cb1772c1
|
@ -350,6 +350,29 @@
|
|||
<input type="text" [disabled]="true" id="filename" class="form-control" [value]="videoSource.filename" />
|
||||
</div>
|
||||
|
||||
<div class="form-group imported-from">
|
||||
<label i18n for="importedFrom">Imported from</label>
|
||||
|
||||
<my-help>
|
||||
<ng-template ptTemplate="preHtml">
|
||||
<ng-container i18n>
|
||||
The URL where this video is imported from
|
||||
</ng-container>
|
||||
</ng-template>
|
||||
</my-help>
|
||||
|
||||
<input
|
||||
id="importedFrom"
|
||||
formControlName="importedFrom"
|
||||
type="text"
|
||||
class="form-control"
|
||||
/>
|
||||
|
||||
<div *ngIf="formErrors.importedFrom" class="form-error">
|
||||
{{ formErrors.importedFrom }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group originally-published-at">
|
||||
<label i18n for="originallyPublishedAt">Original publication date</label>
|
||||
<my-help>
|
||||
|
|
|
@ -161,6 +161,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
|
|||
previewfile: null,
|
||||
support: VIDEO_SUPPORT_VALIDATOR,
|
||||
schedulePublicationAt: VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR,
|
||||
importedFrom: null,
|
||||
originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR,
|
||||
liveStreamKey: null,
|
||||
permanentLive: null,
|
||||
|
|
|
@ -23,6 +23,7 @@ export class VideoEdit implements VideoUpdate {
|
|||
thumbnailUrl: string
|
||||
previewUrl: string
|
||||
scheduleUpdate?: VideoScheduleUpdate
|
||||
importedFrom?: string
|
||||
originallyPublishedAt?: Date | string
|
||||
|
||||
id?: number
|
||||
|
@ -57,6 +58,7 @@ export class VideoEdit implements VideoUpdate {
|
|||
if (video.previewPath) this.previewUrl = getAbsoluteAPIUrl() + video.previewPath
|
||||
|
||||
this.scheduleUpdate = video.scheduledUpdate
|
||||
this.importedFrom = video.importedFrom
|
||||
this.originallyPublishedAt = video.originallyPublishedAt
|
||||
? new Date(video.originallyPublishedAt)
|
||||
: null
|
||||
|
@ -110,6 +112,7 @@ export class VideoEdit implements VideoUpdate {
|
|||
waitTranscoding: this.waitTranscoding,
|
||||
channelId: this.channelId,
|
||||
privacy: this.privacy,
|
||||
importedFrom: this.importedFrom,
|
||||
originallyPublishedAt: this.originallyPublishedAt
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ export class VideoService {
|
|||
const description = video.description || null
|
||||
const support = video.support || null
|
||||
const scheduleUpdate = video.scheduleUpdate || null
|
||||
const importedFrom = video.importedFrom || null
|
||||
const originallyPublishedAt = video.originallyPublishedAt || null
|
||||
|
||||
const body: VideoUpdate = {
|
||||
|
@ -107,6 +108,7 @@ export class VideoService {
|
|||
previewfile: video.previewfile,
|
||||
pluginData: video.pluginData,
|
||||
scheduleUpdate,
|
||||
importedFrom,
|
||||
originallyPublishedAt
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,8 @@ async function updateVideo (req: express.Request, res: express.Response) {
|
|||
'support',
|
||||
'description',
|
||||
'commentsEnabled',
|
||||
'downloadEnabled'
|
||||
'downloadEnabled',
|
||||
'importedFrom'
|
||||
]
|
||||
|
||||
for (const key of keysToUpdate) {
|
||||
|
|
|
@ -28,6 +28,7 @@ function buildLocalVideoFromReq (videoInfo: VideoCreate, channelId: number): Fil
|
|||
support: videoInfo.support,
|
||||
privacy: videoInfo.privacy || VideoPrivacy.PRIVATE,
|
||||
channelId,
|
||||
importedFrom: null,
|
||||
originallyPublishedAt: videoInfo.originallyPublishedAt
|
||||
? new Date(videoInfo.originallyPublishedAt)
|
||||
: null
|
||||
|
|
|
@ -17,6 +17,7 @@ export interface VideoCreate {
|
|||
downloadEnabled?: boolean
|
||||
privacy: VideoPrivacy
|
||||
scheduleUpdate?: VideoScheduleUpdate
|
||||
importedFrom?: string
|
||||
originallyPublishedAt?: Date | string
|
||||
|
||||
thumbnailfile?: Blob | string
|
||||
|
|
|
@ -18,6 +18,7 @@ export interface VideoUpdate {
|
|||
thumbnailfile?: Blob
|
||||
previewfile?: Blob
|
||||
scheduleUpdate?: VideoScheduleUpdate
|
||||
importedFrom?: string
|
||||
originallyPublishedAt?: Date | string
|
||||
|
||||
pluginData?: any
|
||||
|
|
|
@ -6426,6 +6426,10 @@ components:
|
|||
format: date-time
|
||||
example: 2021-05-04T08:01:01.502Z
|
||||
description: last time the video's metadata was modified
|
||||
importedFrom:
|
||||
type: string
|
||||
example: https://youtu.be/fe8agy1pb44
|
||||
description: the URL where this video is imported from
|
||||
originallyPublishedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
|
Loading…
Reference in New Issue