Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
0Supa committed Jul 25, 2021
1 parent c207646 commit 26438de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ app.get('/rcp/:channel', async (req, res) => {
clips = JSON.parse(cacheData)
} else {
const data = (await utils.helix(`clips?broadcaster_id=${user[0].id}&first=100`)).body.data
if (!data.length) return res.status(404).send('This channel has no clips')
if (data.length < 5) return res.status(404).send('The channel needs to have at least 5 clips')

clips = data.map(clip => clip.thumbnail_url.replace(/-preview.*/, '.mp4'))
await utils.redis.set(`rc:clips:${user[0].id}`, JSON.stringify(clips), "EX", 86400)
Expand Down

0 comments on commit 26438de

Please sign in to comment.