mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-03-28 12:27:51 -04:00
Fix watch ws api
This commit is contained in:
parent
ac6478fee3
commit
b03cb757f4
@ -3,6 +3,7 @@ pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
bun
|
||||
biome
|
||||
websocat
|
||||
# for psql to debug from the cli
|
||||
postgresql_18
|
||||
# to build libvips (for sharp)
|
||||
|
||||
@ -3,7 +3,6 @@ import Elysia, { type TSchema, t } from "elysia";
|
||||
import { auth } from "./auth";
|
||||
import { updateProgress } from "./controllers/profiles/history";
|
||||
import { getOrCreateProfile } from "./controllers/profiles/profile";
|
||||
import { SeedHistory } from "./models/history";
|
||||
|
||||
const actionMap = {
|
||||
ping: handler({
|
||||
@ -12,7 +11,18 @@ const actionMap = {
|
||||
},
|
||||
}),
|
||||
watch: handler({
|
||||
body: t.Omit(SeedHistory, ["playedDate"]),
|
||||
body: t.Object({
|
||||
percent: t.Integer({ minimum: 0, maximum: 100 }),
|
||||
time: t.Integer({
|
||||
minimum: 0,
|
||||
}),
|
||||
videoId: t.Nullable(
|
||||
t.String({
|
||||
format: "uuid",
|
||||
}),
|
||||
),
|
||||
entry: t.String(),
|
||||
}),
|
||||
permissions: ["core.read"],
|
||||
async message(ws, body) {
|
||||
const profilePk = await getOrCreateProfile(ws.data.jwt.sub);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user