Skip to content

Commit

Permalink
fix: clip live check (#2845)
Browse files Browse the repository at this point in the history
* fix: clip live check

* add error logging
  • Loading branch information
CKY- authored Oct 2, 2024
1 parent f0bb789 commit db8aa59
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/backend/common/handlers/createClipProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ exports.createClip = async function(effect) {
const broadcast = await client.streams.getStreamByUserId(streamerAccount.userId);
const channelId = (await twitchApi.users.getUserById(streamerAccount.userId)).id;

if (broadcast == null) {
renderWindow.webContents.send('error', `Failed to create a clip. Reason: Streamer is not live.`);
return null;
}
// if (broadcast == null) {
// renderWindow.webContents.send('error', `Failed to create a clip. Reason: Streamer is not live.`);
// return null;
// }

if (effect.postLink) {
await twitchChat.sendChatMessage("Creating clip...");
Expand All @@ -36,6 +36,7 @@ exports.createClip = async function(effect) {
});
} catch (err) {
//failed to create clip
logger.error("failed to create clip", err);
}

if (clipId == null) {
Expand All @@ -54,6 +55,7 @@ exports.createClip = async function(effect) {
clip = await client.clips.getClipById(clipId);
} catch (err) {
//failed to get clip
logger.error("failed to create clip", err);
}
if (clip == null) {
await utils.wait(1000);
Expand Down

0 comments on commit db8aa59

Please sign in to comment.