Skip to content

Commit

Permalink
visibility and db changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Feb 3, 2025
1 parent f3d2043 commit 03d88df
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/Models/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,9 @@ private function getSeminarVisibility($cid, $playlist_id)

if (!empty($psv)) {
return [
'visibility' => $psv->getValue('visibility'),
'visible_timestamp' => $psv->getValue('visible_timestamp')
'visibility' => $psv->getValue('visibility'),
'visible_timestamp' => $psv->getValue('visible_timestamp'),
'available' => $psv->getValue('available')
];
}
}
Expand Down
3 changes: 3 additions & 0 deletions lib/Routes/Playlist/PlaylistAddVideos.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function __invoke(Request $request, Response $response, $args)
}

$playlist->videos->store();

Videos::checkEventACL(null, null, $video);

return $response->withStatus(204);
}

Expand Down
2 changes: 2 additions & 0 deletions lib/Routes/Playlist/PlaylistRemoveVideos.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public function __invoke(Request $request, Response $response, $args)
$plvideo->delete();
}

Videos::checkEventACL(null, null, $video);

return $response->withStatus(204);
}

Expand Down
27 changes: 27 additions & 0 deletions migrations/099_add_playlist_availability.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

class AddPlaylistAvailability extends Migration
{
public function description()
{
return 'Add availability status to videos added to course playlists and allow for different types of sync jobs';
}

public function up()
{
$db = DBManager::get();

$stmt = $db->exec('ALTER TABLE oc_playlist_video
ADD COLUMN `available` INT NOT NULL DEFAULT 0 AFTER video_id');

$stmt = $db->exec("ALTER TABLE oc_video_sync
ADD COLUMN `type` ENUM('video', 'coursevideo') NOT NULL DEFAULT 'video' AFTER `state`,
ADD COLUMN `data` TEXT NULL AFTER `type`
");
}

public function down()
{

}
}
4 changes: 2 additions & 2 deletions vueapp/components/Videos/VideoRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
<img class="oc--image-button" :src="cut">
</span>
</a>
<span v-else-if="event.state == 'running'" class="oc--previewimage"
:title="$gettext('Dieses Videos wird gerade von Opencast bearbeitet.')"
<span v-else-if="event.state == 'running' || event.seminar_visiblity.available == '0'" class="oc--previewimage"
:title="$gettext('Dieses Video wird gerade von Opencast vearbeitet.')"
>
<studip-icon class="oc--image-button" shape="admin" role="status-yellow"></studip-icon>
</span>
Expand Down

0 comments on commit 03d88df

Please sign in to comment.