File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -499,15 +499,25 @@ public function update(array $json)
499
499
) {
500
500
// Load playlist from Opencast
501
501
$ playlist_client = ApiPlaylistsClient::getInstance ($ this ->config_id );
502
- $ oc_playlist = $ playlist_client ->getPlaylist ($ this ->service_playlist_id );
503
502
504
- if ($ oc_playlist ) {
505
- self ::checkPlaylistACL ($ oc_playlist , $ this );
506
- } else {
507
- // Load or update failed in Opencast
503
+ // Update playlist in Opencast
504
+ $ oc_update_data = [];
505
+ foreach (['title ' , 'description ' , 'creator ' ] as $ key ) {
506
+ if (array_key_exists ($ key , $ json )) {
507
+ $ oc_update_data [$ key ] = $ json [$ key ];
508
+ }
509
+ }
510
+
511
+ $ oc_playlist = $ playlist_client ->updatePlaylist ($ this ->service_playlist_id , $ oc_update_data );
512
+
513
+ if (!$ oc_playlist ) {
514
+ // Update failed in Opencast
508
515
return false ;
509
516
}
510
517
518
+ // Ensure playlist acls are correct
519
+ self ::checkPlaylistACL ($ oc_playlist , $ this );
520
+
511
521
// Ensure playlist data is consistent
512
522
$ json ['title ' ] = $ oc_playlist ->title ;
513
523
$ json ['description ' ] = $ oc_playlist ->description ;
You can’t perform that action at this time.
0 commit comments