Skip to content

Commit

Permalink
Show status of videos in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrahn committed Sep 25, 2023
1 parent d139d7a commit c3def90
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cronjobs/opencast_clear_recycle_bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function execute($last_result, $parameters = array())
{
echo "Deletes all videos that have been marked as trash for at least " . \Config::get()->OPENCAST_CLEAR_RECYCLE_BIN_INTERVAL . " days\n";

$videos = Videos::findBySql("trashed=true AND trashed_timestamp < NOW() - INTERVAL " . \Config::get()->OPENCAST_CLEAR_RECYCLE_BIN_INTERVAL ." DAY");
$videos = Videos::findBySql("trashed=true AND state!='running' AND trashed_timestamp < NOW() - INTERVAL " . \Config::get()->OPENCAST_CLEAR_RECYCLE_BIN_INTERVAL ." DAY");
foreach ($videos as $video) {
echo "Video #" . $video->id . " (" . $video->title . ") ";
if ($video->removeVideo()) {
Expand Down
15 changes: 14 additions & 1 deletion vueapp/components/Videos/Actions/VideoDeletePermanent.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<StudipDialog
<StudipDialog v-if="event.state !== 'running'"
:title="$gettext('Aufzeichnung entfernen')"
:confirmText="$gettext('Akzeptieren')"
:confirmClass="'accept'"
Expand All @@ -14,6 +14,19 @@
<translate>Möchten Sie die Aufzeichnung wirklich unwiderruflich entfernen?</translate>
</template>
</StudipDialog>

<StudipDialog v-else
:title="$gettext('Aufzeichnung entfernen')"
:closeText="$gettext('Abbrechen')"
:closeClass="'cancel'"
height="215"
@close="decline"
@confirm="removeVideo"
>
<template v-slot:dialogContent>
<translate>Das Video wird zurzeit verarbeitet und kann deshalb nicht unwiderruflich entfernt werden. Versuchen Sie es zu einem späteren Zeitpunkt erneut.</translate>
</template>
</StudipDialog>
</div>
</template>

Expand Down
40 changes: 22 additions & 18 deletions vueapp/components/Videos/VideoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<Tag v-for="tag in event.tags" v-bind:key="tag.id" :tag="tag.tag" />
</div>

<div v-if="!videoSortMode && menuItems.length > 0 && event.state != 'running'" class="oc--actions-container">
<div v-if="!videoSortMode && menuItems.length > 0" class="oc--actions-container">
<StudipActionMenu :items="menuItems"
:collapseAt="menuItems.length > 1"
@performAction="performAction"
Expand Down Expand Up @@ -263,13 +263,15 @@ export default {
if (!this.event?.trashed) {
if (this.canEdit) {
menuItems.push({
id: 1,
label: this.$gettext('Bearbeiten'),
icon: 'edit',
emit: 'performAction',
emitArguments: 'VideoEdit'
});
if (this.event?.state !== 'running') {
menuItems.push({
id: 1,
label: this.$gettext('Bearbeiten'),
icon: 'edit',
emit: 'performAction',
emitArguments: 'VideoEdit'
});
}
/*
menuItems.push({
Expand Down Expand Up @@ -308,7 +310,7 @@ export default {
});
}
if (this.event?.publication?.annotation_tool) {
if (this.event?.publication?.annotation_tool && this.event?.state !== 'running') {
menuItems.push({
id: 6,
label: this.$gettext('Anmerkungen hinzufügen'),
Expand All @@ -318,14 +320,16 @@ export default {
});
}
menuItems.push({
id: 7,
label: this.$gettext('Untertitel hinzufügen'),
icon: 'accessibility',
emit: 'performAction',
emitArguments: 'CaptionUpload'
});
if (this.event?.state !== 'running') {
menuItems.push({
id: 7,
label: this.$gettext('Untertitel hinzufügen'),
icon: 'accessibility',
emit: 'performAction',
emitArguments: 'CaptionUpload'
});
}
menuItems.push({
id: 8,
label: this.$gettext('Zum Löschen markieren'),
Expand All @@ -334,7 +338,7 @@ export default {
emitArguments: 'VideoDelete'
});
}
if (this.downloadAllowed) {
if (this.downloadAllowed && this.event?.state !== 'running') {
menuItems.push({
id: 2,
label: this.$gettext('Medien runterladen'),
Expand Down
3 changes: 2 additions & 1 deletion vueapp/components/Videos/VideoUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ export default {
'episode': episode_id,
'config_id': view.selectedServer.id,
'title': uploadData.title,
'description': uploadData.description
'description': uploadData.description,
'state': 'running'
})
.then(({ data }) => {
this.$store.dispatch('addMessage', data.message);
Expand Down

0 comments on commit c3def90

Please sign in to comment.