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.
This commit is contained in:
Ingo Oppermann 2022-07-20 09:21:06 +02:00
parent b952e4680f
commit d7dd3b0969
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
3 changed files with 11 additions and 2 deletions

View File

@ -2068,7 +2068,7 @@ class Restreamer {
const settings = {
player: 'videojs',
playersite: true,
playersite: false,
channelid: 'current',
title: 'restreamer',
share: true,

View File

@ -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}`);

View File

@ -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) {
</Grid>
</Grid>
</Grid>
<Grid item xs={12} display={{xs: 'block', md: 'none'}}>
<Grid item xs={12} display={{ xs: 'block', md: 'none' }}>
<Divider />
</Grid>
<Grid item xs={12} md={6}>