From d7dd3b0969418de0d220ce0765cd6b2fd5c95aae Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Wed, 20 Jul 2022 09:21:06 +0200 Subject: [PATCH] Update playersite on saving a channel (datarhei/restreamer#362) In case the playersite is enabled and the metadata of a channel e.g. its name changes, the playersite needs also to be updated in order to reflect this change. As a consequence the playersite has to be enabled explicitely otherwise it will get enabled without the user wanting it. --- src/utils/restreamer.js | 2 +- src/views/Edit/Wizard/index.js | 3 +++ src/views/Edit/index.js | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/utils/restreamer.js b/src/utils/restreamer.js index cf71173..d5d1884 100644 --- a/src/utils/restreamer.js +++ b/src/utils/restreamer.js @@ -2068,7 +2068,7 @@ class Restreamer { const settings = { player: 'videojs', - playersite: true, + playersite: false, channelid: 'current', title: 'restreamer', share: true, diff --git a/src/views/Edit/Wizard/index.js b/src/views/Edit/Wizard/index.js index 9bd146d..ef306fa 100644 --- a/src/views/Edit/Wizard/index.js +++ b/src/views/Edit/Wizard/index.js @@ -188,6 +188,9 @@ export default function Wizard(props) { // Create/update the player await props.restreamer.UpdatePlayer(_channelid); + // Create/update the playersite + await props.restreamer.UpdatePlayersite(); + notify.Dispatch('success', 'save:ingest', i18n._(t`Main channel saved`)); navigate(`/${_channelid}`); diff --git a/src/views/Edit/index.js b/src/views/Edit/index.js index c67c850..40670e0 100644 --- a/src/views/Edit/index.js +++ b/src/views/Edit/index.js @@ -316,6 +316,12 @@ export default function Edit(props) { notify.Dispatch('warning', 'save:ingest', i18n._(t`Failed to update the player`)); } + // Create/update the playersite + res = await props.restreamer.UpdatePlayersite(); + if (res === false) { + notify.Dispatch('warning', 'save:ingest', i18n._(t`Failed to update the playersite`)); + } + return true; }; @@ -501,7 +507,7 @@ export default function Edit(props) { - +