1
0
Fork 0

Allow to edit video attribute "importedFrom" with the UI

This commit is contained in:
Alex Kotov 2023-05-26 11:44:21 +04:00
parent d1d14cd540
commit 43cb1772c1
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
9 changed files with 38 additions and 1 deletions

View File

@ -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>

View File

@ -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,

View File

@ -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
}

View File

@ -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
}

View File

@ -77,7 +77,8 @@ async function updateVideo (req: express.Request, res: express.Response) {
'support',
'description',
'commentsEnabled',
'downloadEnabled'
'downloadEnabled',
'importedFrom'
]
for (const key of keysToUpdate) {

View File

@ -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

View File

@ -17,6 +17,7 @@ export interface VideoCreate {
downloadEnabled?: boolean
privacy: VideoPrivacy
scheduleUpdate?: VideoScheduleUpdate
importedFrom?: string
originallyPublishedAt?: Date | string
thumbnailfile?: Blob | string

View File

@ -18,6 +18,7 @@ export interface VideoUpdate {
thumbnailfile?: Blob
previewfile?: Blob
scheduleUpdate?: VideoScheduleUpdate
importedFrom?: string
originallyPublishedAt?: Date | string
pluginData?: any

View File

@ -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