From a0f93f46e5c98582b890148a8290bd541d61e020 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Tue, 13 Feb 2024 13:24:45 +0100 Subject: [PATCH 1/5] Show correct author in video, fix #913 Set the OC presenter value as author because oc treats the dcc creator field as presenter. --- cronjobs/opencast_worker.php | 2 +- vueapp/components/Videos/VideoUpload.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cronjobs/opencast_worker.php b/cronjobs/opencast_worker.php index db8a6413..6278eb1b 100644 --- a/cronjobs/opencast_worker.php +++ b/cronjobs/opencast_worker.php @@ -107,7 +107,7 @@ public function execute($last_result, $parameters = array()) $video->duration = $event->duration; $video->created = date('Y-m-d H:i:s', strtotime($event->created)); - $video->author = $event->creator; + $video->author = implode(', ', $event->presenter); $video->contributors = implode(', ', $event->contributor); $video->store(); diff --git a/vueapp/components/Videos/VideoUpload.vue b/vueapp/components/Videos/VideoUpload.vue index 1a669c83..fa9d84e9 100644 --- a/vueapp/components/Videos/VideoUpload.vue +++ b/vueapp/components/Videos/VideoUpload.vue @@ -232,8 +232,8 @@ export default { selectedWorkflow: false, fileUploadError: false, upload: { - creator: this.currentUser.username, - contributor: this.currentUser.fullname, + creator: this.currentUser.fullname, + contributor: '', playlist_token: null, recordDate: format(new Date(), "yyyy-MM-dd'T'HH:mm", { locale: de}), subject: this.$gettext('Medienupload, Stud.IP') From 39ba2ffdefeed31fd8447828d61cb5bf40d6505b Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Tue, 13 Feb 2024 13:31:27 +0100 Subject: [PATCH 2/5] Rename author to presenters in UI, ref #913 Add input fields for adding and updating presenters. --- lib/Models/Videos.php | 6 +++++- lib/Routes/Video/VideoAdd.php | 2 +- vueapp/components/Videos/Actions/VideoEdit.vue | 7 +++++++ vueapp/components/Videos/VideoRow.vue | 2 +- vueapp/components/Videos/VideoUpload.vue | 11 ++++++++++- vueapp/components/Videos/VideosTable.vue | 2 +- 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/Models/Videos.php b/lib/Models/Videos.php index 3a5fa525..714200b2 100644 --- a/lib/Models/Videos.php +++ b/lib/Models/Videos.php @@ -599,7 +599,7 @@ public function haveCoursePerm(string $perm) public function updateMetadata($event) { $api_event_client = ApiEventsClient::getInstance($this->config_id); - $allowed_metadata_fields = ['title', 'contributors', 'subject', 'language', 'description', 'startDate']; + $allowed_metadata_fields = ['title', 'author', 'contributors', 'subject', 'language', 'description', 'startDate']; $metadata = []; foreach ($allowed_metadata_fields as $field_name) { @@ -610,6 +610,10 @@ public function updateMetadata($event) $id = 'subjects'; $value = [$value]; } + if ($field_name == 'author') { + $id = 'creator'; + $value = [$value]; + } if ($field_name == 'contributors') { $id = 'contributor'; $value = [$value]; diff --git a/lib/Routes/Video/VideoAdd.php b/lib/Routes/Video/VideoAdd.php index 858099d6..72612366 100644 --- a/lib/Routes/Video/VideoAdd.php +++ b/lib/Routes/Video/VideoAdd.php @@ -43,7 +43,7 @@ public function __invoke(Request $request, Response $response, $args) 'duration' => $event['duration'], 'state' => $event['state'], 'created' => date('Y-m-d H:i:s'), - 'author' => get_fullname($user->id), + 'author' => $event['author'], 'available' => true ]); if (!$video->token) { diff --git a/vueapp/components/Videos/Actions/VideoEdit.vue b/vueapp/components/Videos/Actions/VideoEdit.vue index d5dc043d..6bddf54c 100644 --- a/vueapp/components/Videos/Actions/VideoEdit.vue +++ b/vueapp/components/Videos/Actions/VideoEdit.vue @@ -32,6 +32,13 @@ name="title" v-model="event.title" required> + + + +