tangled
alpha
login
or
join now
dunkirk.sh
/
smokie
1
fork
atom
a fun bot for the hc slack
1
fork
atom
overview
issues
pulls
pipelines
chore: only listen to files in dms and fix video api
dunkirk.sh
11 months ago
381ee8a0
b458314c
verified
This commit was signed with the committer's
known signature
.
dunkirk.sh
SSH Key Fingerprint:
SHA256:DqcG0RXYExE26KiWo3VxJnsxswN1QNfTBvB+bdSpk80=
+5
-2
2 changed files
expand all
collapse all
unified
split
src
features
api
routes
video.ts
takes
services
upload.ts
+3
-2
src/features/api/routes/video.ts
···
5
5
6
6
export default async function getVideo(url: URL): Promise<Response> {
7
7
try {
8
8
-
const videoId = url.pathname.split("/")[2];
9
9
-
const thumbnail = url.pathname.split("/")[3] === "thumbnail";
8
8
+
const path = url.pathname.split("/").filter(Boolean);
9
9
+
const videoId = path[2];
10
10
+
const thumbnail = path[3] === "thumbnail";
10
11
11
12
if (!videoId) {
12
13
return new Response(JSON.stringify({ error: "Invalid video id" }), {
+2
src/features/takes/services/upload.ts
···
13
13
14
14
if (!user) return;
15
15
16
16
+
if (!payload.channel.startsWith("D")) return;
17
17
+
16
18
const takesNeedUpload = await db
17
19
.select()
18
20
.from(takesTable)