This commit is contained in:
Henry Jameson 2026-01-14 16:33:01 +02:00
commit 82c09f59da

View file

@ -113,28 +113,28 @@ const loop = async () => {
);
const { state } = await response.json();
const isLive = state.id === 1; // published
console.info('Live: ', isLive, globalState.currentlyLive);
// console.info('Live: ', isLive, globalState.currentlyLive);
const stateChange = isLive !== globalState.currentlyLive;
console.info('State change', stateChange);
// console.info('State change', stateChange);
globalState.currentlyLive = isLive;
console.info('State: ', state);
// console.info('State: ', state);
if (stateChange) {
if (isLive) {
console.info('Went live!');
const postResult = await post({
spoiler_text: 'Stream announcment',
status: [
'@hj just went live on peertube',
'',
`https://tube.ebin.club/w/${videoId}`,
].join('\n'),
visibility: 'public',
});
console.info('post: ' + postResult.status);
// const postResult = await post({
// spoiler_text: 'Stream announcment',
// status: [
// '@hj just went live on peertube',
// '',
// `https://tube.ebin.club/w/${videoId}`,
// ].join('\n'),
// visibility: 'public',
// });
// console.info('post: ' + postResult.status);
const scrobbleResult = await scrobble({
artist: 'Peertube',
// artist: 'Peertube',
title: 'Streaming on PeerTube',
external_link: `https://tube.ebin.club/w/${videoId}`,
});