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