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 { 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}`,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue