cut early if no video
This commit is contained in:
parent
b66e27d49b
commit
9ad2437a79
@ -51,6 +51,7 @@ export const webhookRoutes = (fastify, _, done) => {
|
||||
const feed = body["feed"];
|
||||
// Example processing: log the video IDs of new videos
|
||||
const entry = feed.entry[0];
|
||||
if(!entry) return reply.code(200).send();
|
||||
const [{users: user, sites: site}] = await db.select().from(users).leftJoin(sites, eq(users.id, sites.user_id)).where(eq(users.channel_id, "UC" + feed["yt:channelId"][0]));
|
||||
if (!user || !site) throw new Error("User not found");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user