cleanup
This commit is contained in:
parent
8d6d9481c2
commit
82c09f59da
1 changed files with 14 additions and 14 deletions
28
index.js
28
index.js
|
|
@ -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}`,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue